Repository navigation
CI: get tests assert codes, not sentences (#1089) - #1553
Merged
Mikola Lysenko (mikolalysenko) merged 4 commits intoOct 15, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
14 tasks
The get covgap file pinned whole English sentences, so a copy edit to get's output broke tests that were really about exit codes and disk state (#1089, child 5, get slice). covgap_commands_get.rs (its own test binary) moves into the get suite: - get_failure_paths.rs asserts exit, status, error.code, event errorCodes, warning codes and disk state through common::envelope. It has no 4+-word sentence asserts; the old file had 22. - get_render.rs keeps the human-output checks, one per message family, including the human halves of the old both-modes tests. - get_fixture.rs holds the shared fixtures once. A new --json test covers the global empty-prefix noPackages exit. coverage_fix_get_double_json.rs is renamed get_single_json_document.rs. The CI shard timings fold the removed binary into get. Assisted-by: Claude Code:claude-opus-5-5
- The 404 view test again checks the fixed reason text: it is the only thing that tells the Ok(None) arm from a fetch Err, since both record download_failed. - get_edge_cases_e2e and get_modes_e2e use the suite's shared received_paths / requests_containing instead of private copies. received_paths now panics when wiremock recording is off, so a "no request" check can't pass on an empty list. - Doc comment rewrapped. Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 15, 2026 00:09
Collaborator
Author
|
BugBot review Generated by Claude Code |
…lope-asserts # Conflicts: # scripts/ci-test-durations.json
Collaborator
Author
|
bugbot run 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 0d4e7cf. Configure here.
Collaborator
Author
|
Ready for review at
For reviewers: this is a test-only change. It moves Generated by Claude Code |
Tanmay Singla (Tanmay182003)
approved these changes
Oct 15, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-ci-get-envelope-asserts
branch
October 15, 2026 01:58
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 15, 2026
Resolves the ci-test-durations.json conflict with #1553 (get split) and repoints the two get-suite doc comments that named the deleted covgap_commands_scan_hosted file. Assisted-by: Claude Code:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Refs #1089 (child 5,
getslice).get --jsonalready emits a{code, message}error, so this slice is unblocked.covgap_commands_scan_mod.rsandcovgap_commands_scan_hosted.rsremain for later slices.What changes
tests/covgap_commands_get.rs(3,424 lines, 65 tests, its own binary) is split into thegetsuite binary:get/get_failure_paths.rs(44 tests) checks exit code,status,error.code, eventerrorCodes,warnings[]codes and disk state throughcommon::envelope. It has 0.contains("…")asserts of 4+ words; the old file had 22.get/get_render.rs(29 tests) holds the human and--silentoutput checks, one per message family. This includes the human halves of the old both-modes tests (blob-write failure,noMatch, vendored and hosted lock-held, forced identifier type, proxy 403), which are now split into a JSON test and a render test. 18 sentence asserts remain, all in the render suite, as the tracker's target design calls for.get/get_fixture.rsholds the shared fixtures once. It addstraversal_files,run_get_via_proxyandhosted_project_with_held_lock, which used to be inlined.patch_no_applicable_files(uuid guardrail),blob_write_failed(exact message match dropped),manifest_write_failed(×3, was"Failed to write manifest"),lock_held(hosted exact-message match dropped) andidentifier_invalid(forced--id/--cve/--ghsa; the message is read only for the kind it names). The engine tests stop comparingevents[].errorto"patch has no applicable files"and"Blob decode or write failed".engine_view_404_is_download_failedkeepserror == "could not fetch details". A view 404 (Ok(None)) and a fetchErrboth recorddownload_failed, so that fixed text is the only thing telling the two arms apart (found in /code-review).--jsontest:global_package_search_empty_prefix_is_no_packages. Before, only the human message covered thenoPackagesexit for an empty--global-prefix.get/coverage_fix_get_double_json.rsis renamedget/get_single_json_document.rs, unchanged.get_edge_cases_e2e.rsandget_modes_e2e.rsdrop their privatereceived_paths/requests_containingfor the fixture's copies.received_pathsnow panics when wiremock recording is off, so a "no request" check can't pass on an empty list.scripts/ci-test-durations.json(Windows shard timings only): the removed binary's entry is dropped, andgetgoes from 8.01s to 9.82s (the two runtimes summed).scan/covgap_commands_scan_vendor_flow.rspoints at the new test location.CI cost
Workflows are unchanged. A lean PR run has the same ~28 Linux jobs before and after, at roughly the same job-minutes (~8 min wall). The Linux test shards link one fewer integration-test binary, which saves a few seconds per shard. That is too small for a
ci-perflabel.The moved tests include
cfg(unix)bodies (read-only.socket, first-party symlink), andprestage_lock_fileis nowcfg(unix), since only unix tests use it. Locally, I compiled the suite with everycfg(unix)item compiled out and the Windows venv layout selected (approximating Windows); it built with no warnings in the new files. The one full-scope run on 576b8e9 passed every job, including the macOS and Windows test shards: https://github.com/SocketDev/socket-patch/actions/runs/38658389722.Test evidence
cargo test -p socket-patch-cli --all-features --test get: 167 passed. The 72 new or moved tests (get_failure_paths,get_render) passed 3 runs in a row. This container runs as root, so the read-only-directory tests take their documented skip here; they run for real on CI's non-root runners.cargo test -p socket-patch-cli --all-features --test cli envelope_helper: 11 passed (the private-reader ratchet).cargo fmt --all -- --check: clean.cargo clippy --locked --workspace --all-features -- -D warnings(CI's invocation): clean. With--test get, clippy reports nothing in the new files.ci-okandclippygreen, and every lean job passed. Cursor Bugbot found no issues.python3 -m unittest discover -s scripts/tests: 347 OK, 6 skipped. This includes the shard planner test that readsci-test-durations.json./code-review high
Fixed: the 404 test's branch check (above), the duplicated mock-request helpers in the same binary, and a mis-wrapped doc comment.
Not taken:
SOCKET_*vars could leak into subprocess tests in the same binary. This is already handled:hermetic::commandremoves every flag-boundSOCKET_*var by name (GLOBAL_ARG_ENV_VARS/LOCAL_ARG_ENV_VARS, plus theSOCKET_CLI_*peers), not only the ones present when the sweep runs (common/hermetic.rs, pinned byspawn_env_hygiene::command_drops_flag_bound_vars_set_after_it_is_built). Every subprocessgethere goes throughcommon::run_with_env, which useshermetic::command.run_get_via_proxyinget_invariants.rstoo. Those two tests sit outside this slice, and each documents its proxy setup inline; I left them as is.Still open in #1089
Child 5's scan files (
covgap_commands_scan_mod.rs,covgap_commands_scan_hosted.rs) and child 6 (render suites and the remaining non-covgap files).🤖 Generated with Claude Code
https://claude.ai/code/session_017icypW7qeEf7tGLJUewAZh
Note
Low Risk
Test-only refactor with no production code changes; CI may need the updated shard timings for the consolidated
getbinary.Overview
Reorganizes
getintegration tests (#1089) by removing the standalonecovgap_commands_get.rsbinary and folding its coverage into thegettest suite.get_failure_paths.rskeeps--jsoncontracts: exit codes,status,error.code, eventerrorCodes,warnings[], and disk state viacommon::envelopehelpers instead of long English string matches.get_render.rsholds human/--silentoutput pins for the same flows. Shared mocks, runners, and fixtures live inget_fixture.rs(includingreceived_pathsthat fails if wiremock recording is off).Adds a JSON test for the empty
--global-prefixnoPackagespath, renamescoverage_fix_get_double_json→get_single_json_document, wiresmain.rsfor the new modules, and updates a scan vendor-flow comment to the new test location.Reviewed by Cursor Bugbot for commit 576b8e9. Configure here.
Generated by Claude Code