Skip to content

v5 tests: one suite per command, retire #257 oracles - #297

Merged
Mikola Lysenko (mikolalysenko) merged 9 commits into
release/v5-prereleasefrom
v5/one-suite-per-command
Sep 29, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 9 commits into
release/v5-prereleasefrom
v5/one-suite-per-command

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:Claude Opus 5.5


Workstream W2 of the v5 waste-review follow-ups (#286).

Finding Outcome
F03: delete #257 "verbatim previous implementation" oracles after golden snapshots done (partial). The rewriter and parser oracles are deleted: hosted npm, yarn classic, pnpm, cargo lock, composer, golang, uv/python lock, pdm plan, pdm/poetry parse reuse, and the reference POM parser. Each seeded sweep now replays against per-case golden digests (crates/socket-patch-core/src/golden.rs, tests/equivalence/*.golden). The goldens were blessed while the oracles still asserted equality (a19da46, then d61f6ba). Kept: the crawler oracles (cargo, composer, go, maven, npm, nuget, python). A crawler's output follows the filesystem's readdir order, and every crawler golden blessed on ext4 failed when replayed on tmpfs. A golden therefore can't pin them portably, whereas the oracle walks the same tree on every OS (912d005). Also kept: about 200 LOC of small memo-vs-fresh and pool-vs-serial oracles over real I/O (copy_tree, cargo_lock memo, reuse, go_mod_edit, common repack, verify, registry_fetch, pypi_wheel), plus group_equivalence's 38-line serial_oracle chain-order spec.
F04: collapse the covgap_/coverage_fix_/in_process_ categories into one suite per command done (partial). Category files for apply, get, remove, rollback, repair, scan, vendor, update and the global CLI now live in tests/<cmd>/, one binary per command. Files keep their names as modules for traceability. Deferred: the 82 in-process or env-mutating binaries (in_process_*, most covgap_commands_*, cli_parse_*). They share process-global state (notice SILENT/JSON, the socket-cli config OnceLock, the API client's *_SHOWN flags), so merging them changes test isolation until those statics are made resettable.
F58: cut the CLI integration-test binaries by merging small ones done. 67 subprocess-only binaries → 9 suites, so the CLI goes from 223 → 165 test binaries. Kept separate: every binary a workflow names (64), docker_e2e_*, and crawl_fd_limit_e2e (process-global walk pool).
F10: dedupe the CRLF/corrupt/dry-run/round-trip invariants into table-driven tests deferred. Re-verified: the ~17 vendor backends each build their own fixture (blobs, installed tree, record, run fn), and no shared fixture interface exists at the LockModel level. Table-driving them needs a new cross-backend fixture trait, which is a design change for its own PR. It would save LOC, but no CI time: all of these tests live in the single core lib binary.

Measured savings

CI status on fe293ed (after merging #292 and #296)

Test evidence (local, Linux)

  • socket-patch-core lib on fe293ed: 4492 passed as non-root, with TMPDIR on tmpfs as well as on ext4, so the goldens are filesystem-independent.
    • As root, 4 known root-only permission tests fail, and they fail identically on 14a9cb0.
    • On 14a9cb0 the stage_local_artifact peak-RSS test also fails as root; it inherits the parent's RSS under a full parallel run.
  • Goldens replay deterministically across repeated runs as root and as nobody.
  • The 9 merged CLI suites pass. The only failures are 2 root-only "unremovable file" repair tests; they fail identically in the pre-merge binaries, and repair passes 116/116 as non-root.
  • Before the base merges, the suites ran 3 rounds with the same results each time.
  • After the v5: remove dead code and v3 compatibility shims #296 merge, each moved CLI test file equals v5: remove dead code and v3 compatibility shims #296's version plus only this PR's mechanical #[path]/use crate:: edits.
  • cargo clippy --workspace --all-features -- -D warnings is clean, and --all-targets is clean for core and CLI.
  • scripts/tests (118 tests) pass.
  • Deletions: no remaining references to any removed oracle symbol or file (grep), and the build is clean.
  • Adversarial review ran with four parallel reviewers: correctness, coverage lost, CI equivalence, and owner decisions.
    • The crawler-golden portability finding came from that review and led to 912d005.
    • No workflow, script or path filter names a moved binary.
    • The owner decisions hold: vlt and PM-version coverage untouched, no setup or hosted ledger, no maven/nuget vendoring code changed.

Notes for reviewers

  • Golden digests cover the Debug/JSON form of each result, so a dependency bump that rewords an error, a new lock fixture, or a changed DepOverride shape needs a re-bless (SOCKET_PATCH_BLESS_GOLDEN=1). Review that diff like any golden change: for a pure input-shape change, only the input-digest column should move.
  • Three env-gated benchmark oracle tests are deleted: SOCKET_PATCH_{COMPOSER_FIXTURE,GO_FIXTURES,PY_LOCK_FIXTURES}. No CI job sets these.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB

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
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
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
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
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
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 Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

[agent] vlt patch compatibility / install-proof is red for vlt 0.0.0-11 (ubuntu and windows) and 0.0.0-1 (ubuntu). The ubuntu 0.0.0-11 job failed on 912d005 (job). All three failed again on dbb5848: ubuntu 0.0.0-1, windows 0.0.0-11.

On ubuntu, three hosted tests in e2e_redirect_vlt_build fail: crlf_lock, idempotence and rollback_byte_exact. In each, rollback doesn't restore the lock's original tarball URL. On windows the same job exits 1. The tail of its log shows only the later suites passing; e2e_redirect_vlt_build runs before them, so I expect the same three tests but haven't confirmed that from the log.

This isn't this PR's failure:

I haven't found a fix to port yet. I merged the new base (#291) in dbb5848, and the jobs still fail there.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] PDM patch compatibility / native (ubuntu-latest, 2.3.4) is red on dbb5848 (job). One cell fails: optional agent. Its checks rollbackExit0, rollbackRestoresUpstreamBytes and rollbackClearsManifest all fail. The other 35 cells pass or refuse as expected.

I don't think this is from this PR. The same workflow passed on the previous head 912d005 (run 36497447814) and on #293 and #294, which have the same base. The only change since 912d005 is the base merge, which touches CI, scripts and e2e_nuget.rs, not the CLI or the pdm code. I'll re-run the failed job once when the run finishes. A second failure would make it real, and I'll root-cause it then.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] CI / yarn-classic 1.7.0 is red on dbb5848 (job). It's base-inherited: yarn-classic 1.0.2, 1.6.0, 1.7.0 and 1.9.4 all failed on the base's last full CI run for #282's head (run 36474481876), before this PR existed. This PR doesn't touch yarn-classic code or its e2e tests. I haven't found a fix to port.


Generated by Claude Code

@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review September 29, 2026 00:23
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] ready to land

CI on dbb5848 is green apart from base-inherited failures:

The one PDM flake passed on re-run. There's no merge conflict. Coverage is 97.35% → 97.35%, with 25 fewer missed lines. The findings table, measured savings and test evidence are in the description.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

#292 landed on release/v5-prerelease as a7b0d00; please merge origin/release/v5-prerelease again, resolve conflicts, get green, and keep it ready.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] Merged release/v5-prerelease at a7b0d00 (#292) into 5e16953. There were no conflicts, and #292 doesn't touch any of the moved test files.

Local checks:

  • workspace clippy is clean;
  • the merged apply, get, scan and vendor suites pass;
  • repair passes 116/116 as non-root (the only two root-run failures are the known "unremovable file" tests).

CI is re-running on the new head. The PR stays ready.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] PDM patch compatibility / native (ubuntu-latest, 2.17.3) is red on 5e16953 (job). One case fails: direct hosted, on the appliedExactlyOne check. It was the first case in the run. The other 37 cases pass, and 6 refuse or are unsupported as expected.

This PR changes only test code and goldens, but the base merge brought in #292, which changes the hosted fetch path (api/client.rs, vendor_prefetch.rs, vendor/pypi.rs). So the cause is either a flake or something from #292. The same workflow is running now on #293, #294 and #296, which merged #292 too. I'll compare against those and re-run this job once when the run finishes.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

#296 landed on release/v5-prerelease as 1e3ace6; please merge origin/release/v5-prerelease again, resolve conflicts, get green, and keep it ready.


Generated by Claude Code

#296 drops DepOverride's berry_zip_url, so the goldens' input digests
(which serialize the deps) are re-blessed: 1848 lines in 12 files
change only their input digest, and every case key and output digest
is unchanged, so the rewrites behave exactly as before. The two
env-gated fixture tests #296 edited stay deleted here.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N9YdJqaGiT9Jf5LN1hDFhB
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] Merged release/v5-prerelease at 1e3ace6 (#296) as fe293ed.

Conflicts: two, in composer_equivalence_tests.rs and golang_equivalence_tests.rs. #296 edited the env-gated fixture tests that this PR deletes, so I kept them deleted. #296's other changes to the moved CLI test files (the --one-off removals) came across through rename detection. After the merge, each moved file equals #296's version plus only this PR's mechanical #[path]/use crate:: edits.

Goldens re-blessed: #296 removes DepOverride.berry_zip_url, and the golden inputs serialize the deps, so their digests changed. Across 12 golden files, 1848 lines changed only in the input-digest column. Every case key and every output digest is byte-identical, so the rewriters' behavior is unchanged.

Local checks:

  • core lib: 4492/4492 as non-root on tmpfs;
  • the 9 merged CLI suites pass (as root, only the 2 known root-only repair tests fail);
  • workspace clippy and --all-targets clippy are clean.

CI is re-running. The PR stays ready.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Coordinator: #297 is next in the landing order (#287 is still a draft and is skipped). It is blocked only because there is no [agent] ready to land comment newer than the last push, fe293ed (07:28Z). The branch contains the current base (1e3ace6). Once CI on fe293ed finishes, post [agent] ready to land with its results and it will land on the next run.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] ready to land

CI on fe293ed has finished. The branch contains the current base (1e3ace6, #296).


Generated by Claude Code

@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit b97a1c2 into release/v5-prerelease Sep 29, 2026
440 of 448 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the v5/one-suite-per-command branch September 29, 2026 09:18
Mikola Lysenko (mikolalysenko) pushed a commit that referenced this pull request Sep 29, 2026
Brings in #297, which groups the CLI tests into one binary per command
and replaces the #257 oracles with golden files. It merges cleanly;
this PR's test binaries stay at the top level, as most still do.
Clippy and the policy, in-memory, parity, e2e policy, parser, help,
scan and get suites pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BKsyzefGhAnPkYmXCwq3H3
Mikola Lysenko (mikolalysenko) pushed a commit that referenced this pull request Sep 29, 2026
Brings in #297, which groups the CLI tests into one binary per command
and replaces the oracle comparisons with golden files. The merge had
no conflicts. This branch's own suites stay separate binaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AvGSu5jGg1z3f3sePc2eHC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants