Skip to content

Commit b97a1c2

Browse files
v5 tests: one suite per command, retire #257 oracles (#297)
* Pin the #257 oracle sweeps with golden digests The randomized equivalence sweeps that compare the blocking-pool crawlers and single-pass rewriters with their pre-#257 oracles now also record, per case, a digest of the generated input and of the output both implementations agreed on, in crates/socket-patch-core/tests/equivalence/*.golden. The oracles still run, so every recorded output is proven equal to the oracle's. The next commit deletes the oracles and keeps the goldens. The crawler goldens were blessed on Linux as a non-root user: the sweeps strip permissions and plant symlinks, so they replay only there (other platforms and root still run the sweeps, without the golden comparison). Also moves the crawler sweeps' xorshift test RNG to crate::test_rng, and renames crawlers::oracle_support to crawlers::test_tree. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB * Retire the #257 crawler and rewriter oracles The equivalence sweeps now replay against the golden digests pinned in the previous commit instead of re-running the verbatim previous implementations: the crawler oracles (cargo, composer, go, maven, npm, nuget, python), the hosted rewriter oracles and the reference POM parser are deleted. Every sweep still generates the same inputs from the same seeds, so a changed output is still caught per case. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB * Pin the pdm and poetry rewrites by golden The pdm plan, pdm and poetry parse-reuse rewrites were checked against #257's verbatim fresh-parse implementations. Their sweeps now record per-case digests, blessed while those oracles still agreed with production, and the oracles are deleted. Golden keys with whitespace are normalized so a case label can never split a golden line. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB * Merge 67 CLI test binaries into command suites The subprocess-only integration tests for apply, get, remove, rollback, repair, scan, vendor, update and the global CLI now build as one binary per command instead of 67, so CI links and runs 58 fewer test binaries. Each file keeps its name as a module, and the shared helpers are declared once per suite, so their self-tests run once per suite instead of once per file. Binaries a workflow names, the docker e2e suites, crawl_fd_limit_e2e and the in-process suites (which share process-global notice and config state) stay separate. Doc links to the moved files are updated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB * Point docs at the merged test suites Rows that named a moved test binary now name its suite and module. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB * Keep the crawler oracles A crawler's output follows the directory order the filesystem hands back, which differs between filesystems: every crawler golden blessed on ext4 failed when replayed on tmpfs, and macOS and Windows skipped them. The per-call oracles walk the same tree as the crawler, so they check the parallel walk on every platform; restore them and drop the crawler goldens. The rewriter goldens are pure text and stay. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1e3ace6 commit b97a1c2

123 files changed

Lines changed: 5325 additions & 3349 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion

‎crates/socket-patch-cli/CLI_CONTRACT.md‎

Lines changed: 4 additions & 4 deletions

‎crates/socket-patch-cli/src/commands/scan/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3243,7 +3243,7 @@ mod tests {
32433243

32443244
// ---- redirectState envelope block (read-only cross-mode visibility) ----
32453245
// The end-to-end envelope placement (report-only + agent runs carry it,
3246-
// hosted/vendored runs don't) is pinned by `tests/scan_invariants.rs`;
3246+
// hosted/vendored runs don't) is pinned by `tests/scan/scan_invariants.rs`;
32473247
// these pin the block builder's own gates and shape.
32483248

32493249
/// Pins present ⇒ the block exists with each pin's canonical purl +

crates/socket-patch-cli/tests/apply_invariants.rs renamed to crates/socket-patch-cli/tests/apply/apply_invariants.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -682,10 +682,8 @@ fn unmatched_purl_exit_semantics_are_pinned() {
682682
assert_eq!(v2["status"], "partialFailure", "{v2}");
683683
}
684684

685-
#[path = "vlt_hosted_common/mod.rs"]
686-
mod vlt_hosted_common;
687-
#[path = "vlt_hosted_common/vendored.rs"]
688-
mod vlt_vendored;
685+
use crate::vlt_hosted_common;
686+
use crate::vlt_vendored;
689687

690688
/// A vlt-vendored purl: `apply` yields it to the vendor ledger (the
691689
/// committed dir artifact is what vlt installs), leaves `.socket/`
File renamed without changes.

crates/socket-patch-cli/tests/cli_gem_variant_mismatch_policy.rs renamed to crates/socket-patch-cli/tests/apply/cli_gem_variant_mismatch_policy.rs

File renamed without changes.

crates/socket-patch-cli/tests/covgap_commands_apply.rs renamed to crates/socket-patch-cli/tests/apply/covgap_commands_apply.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ use serde_json::{json, Value};
3939
use wiremock::matchers::{method, path};
4040
use wiremock::{Mock, MockServer, ResponseTemplate};
4141

42-
#[path = "common/mod.rs"]
43-
mod common;
42+
use crate::common;
4443

4544
use common::{git_sha256, parse_json_envelope, run_with_env};
4645

crates/socket-patch-cli/tests/e2e_safety_advisories.rs renamed to crates/socket-patch-cli/tests/apply/e2e_safety_advisories.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
2828
use std::path::Path;
2929

30-
#[path = "common/mod.rs"]
31-
mod common;
30+
use crate::common;
3231

3332
use common::{
3433
git_sha256, parse_json_envelope, run_with_env, write_blob, write_minimal_manifest, PatchEntry,

crates/socket-patch-cli/tests/in_process_gem_config_warning.rs renamed to crates/socket-patch-cli/tests/apply/in_process_gem_config_warning.rs

File renamed without changes.

crates/socket-patch-cli/tests/in_process_gem_fallback_home.rs renamed to crates/socket-patch-cli/tests/apply/in_process_gem_fallback_home.rs

File renamed without changes.

0 commit comments

Comments
 (0)