Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ jobs:
# target/ (and the cache) much smaller than full debug info.
CARGO_PROFILE_DEV_DEBUG: line-tables-only
CARGO_PROFILE_TEST_DEBUG: line-tables-only
# Build-script dependencies default to no debug info, except crates that
# are also normal dependencies, which take the line above. Which crates
# those are differs between the nextest build and the lib-only doctest
# build (shlex, which cc depends on), so without this the doctest step
# rebuilt cc, every crate whose build script uses it, and everything
# above them.
CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG: line-tables-only
CARGO_PROFILE_TEST_BUILD_OVERRIDE_DEBUG: line-tables-only
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -114,6 +122,9 @@ jobs:
- name: Run knowledge graph closure harness
if: matrix.os == 'ubuntu-latest'
shell: bash
# The harness's own cargo test suites already ran under nextest above.
env:
ATOMIC_HARNESS_SKIP_CARGO_TESTS: 1
run: ATOMIC_BIN="$PWD/target/debug/atomic" bash tests/harness/46_knowledge_graph_closure.sh

fmt:
Expand Down
2 changes: 1 addition & 1 deletion atomic-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ Global identity configuration is stored in `~/.config/atomic/` (or platform equi
cargo test -p atomic-cli

# Validate that every public command path renders help
cargo test -p atomic-cli --test cli_surface_integration_test
cargo test -p atomic-cli --test it -- cli_surface_integration_test::

# Run the black-box CLI harness against a freshly built binary
cargo build -p atomic-cli
Expand Down
10 changes: 5 additions & 5 deletions atomic-cli/src/commands/git/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ mod tests {
}

#[test]
#[serial]
#[file_serial]
#[cfg_attr(
not(unix),
ignore = "the Git shim projection requires lossless unix paths (ProjectTreeError::UnsupportedPlatformPath)"
Expand Down Expand Up @@ -1905,7 +1905,7 @@ mod tests {
}

#[test]
#[serial]
#[file_serial]
#[cfg_attr(
not(unix),
ignore = "the Git shim projection requires lossless unix paths (ProjectTreeError::UnsupportedPlatformPath)"
Expand Down Expand Up @@ -1944,7 +1944,7 @@ mod tests {

#[cfg(not(unix))]
#[test]
#[serial]
#[file_serial]
fn stream_refuses_unsupported_native_paths_before_initialization() {
let temp = tempfile::tempdir().unwrap();
init_git(temp.path());
Expand All @@ -1967,7 +1967,7 @@ mod tests {
}

#[test]
#[serial]
#[file_serial]
#[cfg(unix)]
fn stream_flag_imports_spaces_unicode_percent_and_symlinks() {
let temp = tempfile::tempdir().unwrap();
Expand Down Expand Up @@ -2051,7 +2051,7 @@ mod tests {
}

#[test]
#[serial]
#[file_serial]
fn unsupported_stream_boundary_rejects_before_atomic_or_git_exclude_writes() {
let temp = tempfile::tempdir().unwrap();
init_git(temp.path());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl Fixture {
"[package]\nname = \"version-fixture\"\nversion = \"0.19.1\"\nedition = \"2021\"\n",
)
.unwrap();
fs::write(source.join("build.rs"), include_str!("../build.rs")).unwrap();
fs::write(source.join("build.rs"), include_str!("../../build.rs")).unwrap();
fs::write(
source.join("src/main.rs"),
"fn main() { println!(\"{}\", env!(\"ATOMIC_CLI_VERSION\")); }\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ fn git_import_records_the_real_helpers_history_with_exact_content() {
// import failed with "staged path
// 'atomic-cli/src/commands/push/helpers.rs' renders 27472 byte(s) but
// the commit tree expects 23819 byte(s)".
let c1 = include_bytes!("fixtures/helpers_c1.rs");
let c5 = include_bytes!("fixtures/helpers_c5.rs");
let c6 = include_bytes!("fixtures/helpers_c6.rs");
let c1 = include_bytes!("../fixtures/helpers_c1.rs");
let c5 = include_bytes!("../fixtures/helpers_c5.rs");
let c6 = include_bytes!("../fixtures/helpers_c6.rs");

let root = tempfile::tempdir().unwrap().keep();
let home = tempfile::tempdir().unwrap().keep();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[path = "../src/commands/git/wip.rs"]
#[path = "../../src/commands/git/wip.rs"]
mod wip;

use std::collections::BTreeSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! ```text
//! TMPDIR=/home/aaron/code/work/atomic/target/bench-tmp \
//! cargo test -p atomic-cli --release \
//! --test import_budget_100k_bench -- --ignored --nocapture
//! --test it -- import_budget_100k_bench:: --ignored --nocapture
//! ```
//!
//! The run prints the measured wall-clock numbers and the environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ fn exported_graph_canvas_selection_drag_zoom_and_responsive_layout() {
"</body>",
&format!(
"<script>{}</script></body>",
include_str!("fixtures/graph_canvas_test.js")
include_str!("../fixtures/graph_canvas_test.js")
),
);
let path = directory.path().join("canvas-inspector.html");
Expand Down
88 changes: 88 additions & 0 deletions atomic-cli/tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
//! All atomic-cli integration tests, built as one binary so the workspace is
//! linked once instead of once per file. Each module is a former
//! `tests/<name>.rs`; run one with `cargo test -p atomic-cli --test it <name>::`.
//!
//! `provenance_rpc_sink` stays its own binary: it sets process env vars
//! (`ATOMIC_SERVICE`, `ATOMIC_DAEMON_SOCKET`) that every `atomic` subprocess
//! spawned by a concurrently running test in this binary would inherit.

mod adaptation_regression_test;
mod agent_capture_oracle_cb12a_test;
mod agent_error_integration_test;
mod agent_repair_cb12a_test;
mod bridge_agent_workflow_regression_test;
mod build_version_integration_test;
mod change_ledger_integration_test;
mod change_tree_test;
mod cli_surface_integration_test;
mod clone_sidecar_integration_test;
mod compact_service_integration_test;
mod concurrent_intent_reads_test;
mod cross_stream_matrix_test;
mod git_adoption_cb7b_test;
mod git_anchor_cb7a_test;
mod git_binding_cb6a_test;
mod git_binding_cb6b_test;
mod git_binding_cb6c_test;
mod git_bridge_reconcile_preserved_delete_test;
mod git_cutover_cb13b_test;
mod git_guard_cb0c_test;
mod git_import_bypass_cycle_regression;
mod git_import_cb9a_test;
mod git_import_cb9b_test;
mod git_import_cb9c_test;
mod git_import_corpus_regression_test;
mod git_import_generated_modify_test;
mod git_import_path_audit_test;
mod git_import_sibling_closure_regression;
mod git_import_sibling_leg_modify_regression;
mod git_import_stale_edge_dead_walk_regression;
mod git_import_tracked_vault_regression;
mod git_import_tree_shape_regression;
mod git_observation_cb0a_test;
mod git_projection_cb8a_test;
mod git_push_cb4b_test;
mod git_shim_branch_reconcile_regression;
mod git_shim_cb0d_test;
mod git_shim_cb10a_test;
mod git_shim_cb13d_test;
mod git_shim_daily_workflow_regression;
mod git_shim_logging_test;
mod git_shim_opt_in_test;
mod git_shim_workspace_test;
mod git_transport_cb10b_test;
mod git_wip_cb0b_test;
mod graph_only_export_cb9b_test;
mod hook_health_integration_test;
mod ide_json_integration_test;
mod import_budget_100k_bench;
mod insert_promote_integration_test;
mod intent_attest_external_signer_test;
mod intent_graph_test;
mod intent_turn_binding_test;
mod kg_service_integration_test;
mod logging_integration_test;
mod memory_compatibility_test;
mod native_index_doctor_integration_test;
mod native_view_materialization_regression_test;
mod operation_cli_integration_test;
mod provenance_integration_test;
mod push_integration_test;
mod record_rename_attributes_test;
mod record_stale_conflict_cleanup_test;
mod remote_sandbox_client_test;
mod remove_recorded_path_test;
mod repository_discovery_integration_test;
mod restore_integration_test;
mod routing_parity_test;
mod session_integration_test;
mod shim_census_cb13a_test;
mod status_git_cb11a_test;
mod unrecord_integration_test;
mod vault_context_integration_test;
mod view_confirmation_integration_test;
mod working_copy_preservation_test;
mod working_copy_service_adaptation_test;
mod workspace_txn_boundaries_cb5c_test;
mod workspace_txn_routing_cb5b_test;
mod workspace_txn_routing_cb5c_test;
Original file line number Diff line number Diff line change
Expand Up @@ -1422,19 +1422,19 @@ fn hyperfine_fixture_versions() -> [(&'static str, &'static [u8]); 4] {
[
(
"a658ab8c",
include_bytes!("fixtures/hyperfine/a658ab8c_main.rs"),
include_bytes!("../fixtures/hyperfine/a658ab8c_main.rs"),
),
(
"d4ebdd7b",
include_bytes!("fixtures/hyperfine/d4ebdd7b_main.rs"),
include_bytes!("../fixtures/hyperfine/d4ebdd7b_main.rs"),
),
(
"197f9fb",
include_bytes!("fixtures/hyperfine/197f9fb_main.rs"),
include_bytes!("../fixtures/hyperfine/197f9fb_main.rs"),
),
(
"68fdc2c",
include_bytes!("fixtures/hyperfine/68fdc2c_main.rs"),
include_bytes!("../fixtures/hyperfine/68fdc2c_main.rs"),
),
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ const CHILD_ROOT: &str = "ATOMIC_DATABASE_LOCK_ROOT";
const CHILD_REPORT: &str = "ATOMIC_DATABASE_LOCK_REPORT";
const CHILD_TEST: &str = "database_handles_exclude_incompatible_opens_across_processes";

/// libtest's name for the child test: its module path without the crate name.
fn child_test_name() -> String {
match module_path!().split_once("::") {
Some((_, module)) => format!("{module}::{CHILD_TEST}"),
None => CHILD_TEST.to_string(),
}
}

fn probe(root: &Path) -> String {
let readonly = match Repository::open_readonly_wait(root, Duration::ZERO) {
Ok(_) => "readonly-ok".to_string(),
Expand Down Expand Up @@ -39,7 +47,7 @@ fn probe(root: &Path) -> String {

fn child_probe(root: &Path, report_path: &Path) -> String {
let mut child = Command::new(std::env::current_exe().expect("test binary path"))
.args(["--exact", CHILD_TEST, "--test-threads=1"])
.args(["--exact", &child_test_name(), "--test-threads=1"])
.env(CHILD_ROOT, root)
.env(CHILD_REPORT, report_path)
.stdout(Stdio::piped())
Expand Down
41 changes: 41 additions & 0 deletions atomic-repository/tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//! All atomic-repository integration tests, built as one binary so the workspace is
//! linked once instead of once per file. Each module is a former
//! `tests/<name>.rs`; run one with `cargo test -p atomic-repository --test it <name>::`.

mod causal_file_identity_test;
mod cb_n6_merge_rubric_test;
mod change_signing_test;
mod content_roundtrip_fidelity_test;
mod database_consolidation_shim_test;
mod database_lock_exclusivity_test;
mod database_open_wait_test;
mod effective_history_test;
mod effective_projection_3b_test;
mod equivalence_cb4b_test;
mod implementation_declaration;
mod intent_graph;
mod kg_change_availability;
mod kg_projection;
mod kg_recorded_impact;
mod legacy_database_merge_test;
mod materialize_view_entries_test;
mod migration_recovery_test;
mod patch_evidence;
mod project_identity;
mod project_identity_transport;
mod project_tree_cb4a_test;
mod provenance_checkpoint_test;
mod remote_cache_parity_test;
mod revise_content_regression;
mod schema_guard_test;
mod staging_cb11a_test;
mod stash_attributes_test;
mod state_based_diff_test;
mod unrecord_safety_test;
mod view_delete_test;
mod view_manifest_test;
mod view_setid_test;
mod view_split_test;
mod whole_file_diff_test;
mod workflow_usage;
mod zero_length_vertex_regression_test;
2 changes: 1 addition & 1 deletion docs/intent-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Browser interaction regressions can be run explicitly with Chrome/Chromium:

```sh
ATOMIC_TEST_CHROME=/path/to/chrome \
cargo test -p atomic-cli --test intent_graph_test -- --ignored
cargo test -p atomic-cli --test it -- intent_graph_test:: --ignored
```

Set `ATOMIC_TEST_D3=/path/to/d3.min.js` to use a local D3 v7 bundle for the canvas
Expand Down
4 changes: 2 additions & 2 deletions docs/provenance-pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ multiple pages.

```sh
cargo test -p atomic-cli --bin atomic commands::agent::owner::tests
cargo test -p atomic-repository --test provenance_checkpoint_test
cargo test -p atomic-cli --test database_owner_integration_test
cargo test -p atomic-repository --test it -- provenance_checkpoint_test::
cargo test -p atomic-cli --test it -- database_owner_integration_test::
cargo test --workspace
```

Expand Down
2 changes: 1 addition & 1 deletion docs/record-status-name-conflict.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ inode. Removing and re-adding the file is unnecessary.
cargo build -p atomic-cli --release
ATOMIC_BIN="$PWD/target/release/atomic" bash tests/harness/run_all.sh 39 41
cargo test -p atomic-core -p atomic-repository --lib
cargo test -p atomic-repository --test causal_file_identity_test
cargo test -p atomic-repository --test it -- causal_file_identity_test::
```

Suite 39 is the unchanged prior view-switch regression. Suite 41 adds the
Expand Down
28 changes: 14 additions & 14 deletions docs/shim-review-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,25 +204,25 @@ Check failures and skipped tests in the output.

```sh
cd "$ATOMIC_REVIEW_SOURCE"
cargo test --locked -p atomic-cli \
--test adaptation_regression_test \
--test git_shim_opt_in_test \
--test git_shim_workspace_test \
--test bridge_agent_workflow_regression_test \
--test git_shim_logging_test

cargo test --locked -p atomic-cli \
--test working_copy_service_adaptation_test \
--test compact_service_integration_test
cargo test --locked -p atomic-cli --test it -- \
adaptation_regression_test:: \
git_shim_opt_in_test:: \
git_shim_workspace_test:: \
bridge_agent_workflow_regression_test:: \
git_shim_logging_test::

cargo test --locked -p atomic-cli --test it -- \
working_copy_service_adaptation_test:: \
compact_service_integration_test::
cargo test --locked -p libatomic \
--test record_service_test --test status_service_test --test sandbox_service_test

cargo test --locked -p atomic-repository \
--test database_consolidation_shim_test --test migration_recovery_test
cargo test --locked -p atomic-repository --test it -- \
database_consolidation_shim_test:: migration_recovery_test::

cargo test --locked -p atomic-cli \
--features adoption-test-injection \
--test git_shim_cb13d_test --test git_cutover_cb13b_test
--features adoption-test-injection --test it -- \
git_shim_cb13d_test:: git_cutover_cb13b_test::
```

`working_copy_service_adaptation_test` starts a real RPC server using this
Expand Down
Loading
Loading