Repository navigation
CI: vex tests assert codes, not sentences (#1089) - #1563
Conversation
Assisted-by: Claude Code:claude-opus-5-5
The vex command's coverage-gap tests and its terminal-output tests were two separate test binaries, and many checks matched English sentences on stderr. They now live in one `vex` suite binary: - vex_failure_paths.rs checks the --json contract (exit code, error.code, skipped-event errorCodes, warning codes, disk state) through common::envelope. - vex_go_patches.rs reads the go-patches synthesis guards from --json skipped events and the written document, not stderr lines. - vex_render.rs keeps the human output, one check per message family, with the duplicate human halves merged. - vex_fixture.rs holds one copy of the writers and runners. cli_parse_vex.rs stays its own binary because it mutates the process environment. No production change. Refs #1089. Assisted-by: Claude Code:claude-opus-5-5
Review of the vex suite fold found checks it had loosened:
- the --silent auto-detect case now deletes the first run's document
first, so it proves --silent still writes one;
- the corrupt vendor ledger error must carry its cause ("corrupt")
and, under --silent too, print no per-patch omission;
- the redirect ledger warning must still say the file is malformed
and its records are not consulted;
- skipped events need a non-empty reason, and an error envelope may
leave out its empty events array;
- the runner uses the shared hermetic binary_command().
Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
…lope-asserts # Conflicts: # scripts/ci-test-durations.json
|
bugbot run Generated by Claude Code |
|
Ready for review at
Generated by Claude Code |
The old suppressed-by-silent test failed if 'Multiple project manifests' appeared anywhere on stderr. The merged loop only matched a line that also said 'using package.json', so a reworded warning leaking past --silent would have passed. Assert the phrase is absent under --silent again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
bugbot run Final review of Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 143dac0. Configure here.
|
Ready for review at
Generated by Claude Code |
Final review brief: #1563 at
|
LLM Description written by Claude Code:claude-opus-5-5
Refs #1089 (child 6,
vexslice).What changes
tests/covgap_commands_vex.rs(1,258 lines, 13 tests) andtests/vex_terminal_output.rs(396 lines, 12 tests) were two test binaries. They are now onetests/vex/suite binary:vex/vex_failure_paths.rs(9 tests): the--jsoncontracts, read throughcommon::envelopeand checked againstassert_envelope_invariants. They cover exit code,status,error.code, skipped-eventerrorCodes,warnings[]codes and disk state:manifest_invalidwith stale-doc removal and a FIFO at--output,redirect_ledger_corruptas an advisory (with and without a manifest),vendor_ledger_corruptfailing closed (with and without a manifest),product_multiple_manifests, the--jsondry run,json_requires_output,vex_stale_doc_removedand sorted omission events. Messages are read only for the file they must name and, for the vendor ledger, its cause. The--jsonhalves of the old terminal-output tests moved here.vex/vex_go_patches.rs(3 tests): the go-patches synthesis guards (version-less, stale and tampered replaces, vendor-entry precedence, unselected version,+incompatiblekey). They now read--jsonskipped events (go_version_not_selected,go_workspace_override, the tampered purl as the only skip) and the document written to--output, instead of matchingomitting … from VEX (…)lines on stderr.vex/vex_render.rs(15 tests): human output, one check per message family. These are the old terminal-output tests plus the human halves of the covgap tests. Duplicates were merged: the corrupt-manifest human check joins the existing one, the three vendor-ledger human runs (with a manifest, without one, and--silent) are one table, and the multi-manifest warning and--silentcases are one loop.vex/vex_fixture.rs: one copy of the record and manifest writers, the corrupt-file writers and their untouched checks, and the runners. It merges the tworecord/write_manifestcopies.cli_parse_vex.rsstays its own binary because it mutates process env underserial_test, and that must not share a binary with subprocess tests.scripts/ci-test-durations.jsonfolds the old targets' 0.20 s + 0.18 s intovex.CI cost
No workflow change. A lean PR run stays at about 28 Linux jobs, ~8 min (~110 job-min), before and after. The
testshards link one fewer integration-test binary.Test evidence
cargo fmt --all -- --check: clean.cargo clippy --locked --workspace --all-features -- -D warnings(the CI command): clean.cargo clippy -p socket-patch-cli --all-features --test vex -- -D warnings: clean.cargo test -p socket-patch-cli --all-features --test vex: 47 passed (27 vex tests, plus thecommonself-tests every suite runs).cargo test -p socket-patch-cli --all-features --test cli -- helper_copies(the shared-helper and envelope-reader ratchets): 12 passed.--test command_module_layering: 3 passed.python3 -m pytest scripts/tests -q: 342 passed, 6 skipped.cfg(unix)test (FIFO at--output), so one full-scopeci.ymlrun was dispatched ond455525: https://github.com/SocketDev/socket-patch/actions/runs/38684769170 (success).d455525: green. Bugbot reviewedd455525: no issues./code-review high
Fixed in d455525:
--silentmulti-manifest case now deletes the first run's document first, so it proves--silentstill writes one.corrupt), and under--silentit must also print nopackage_not_foundomission.malformedandnot consulted.reason.eventsarray.hermetic::binary_command().Not fixed, and why:
--jsonmanifest_invalidcheck doesn't pin "Failed to parse manifest JSON".vex_render.rs::corrupt_manifest_error_names_the_filepins that text for the human output, and Tracking: assert stable codes instead of human sentences in CLI tests, and fold the covgap suites #1089 keeps sentence checks out of the--jsonsuites.reasonsentence isn't pinned for the same reason. The human omission lines inomissions_are_sorted_and_listed_oncecarry the same phrase.🤖 Generated with Claude Code
https://claude.ai/code/session_017CGVu5L8YkdSCGj3RxJvtF
Note
Low Risk
Test-only reorganization and assertion style changes; no runtime or CLI behavior is modified.
Overview
Consolidates the
vexCLI integration tests from two binaries (covgap_commands_vex.rs,vex_terminal_output.rs) into a singletests/vex/suite with sharedvex_fixture.rs.The refactor splits coverage by output mode:
vex_failure_paths.rsandvex_go_patches.rsassert--jsonenvelopes (exit codes,error.code,warnings[], skippederrorCodes, document at--output) viacommon::envelopehelpers instead of matching stderr sentences;vex_render.rskeeps human-terminal checks (one family per test), with duplicated cases merged into tables/loops. Adds JSON-only cases such asjson_requires_output, dry-run envelope, sorted skipped events, and stale-doc removal as warning codes.cli_parse_vex.rsstays a separate binary forserial_testenv mutation. Updatesci-test-durations.jsonto replace the old targets withvex. No production code changes.Reviewed by Cursor Bugbot for commit 143dac0. Configure here.
Generated by Claude Code