Repository navigation
Share one docker test harness (#1968, first slice) - #1972
Conversation
Assisted-by: Claude Code:claude-opus-5-5
Add tests/docker_common as the one home for the container plumbing every docker suite copied: cov_docker_args (with sbt's SOCKET_PATCH_DOCKER_BIN branch), skip_if_no_image / skip_or_require_image, run_container and assert_vex_agent_attested. Delete the copies in the 10 docker_e2e agent suites and docker_vendor_common, the plain_sha256/sha256_hex copies (common has sha256_hex), deno's SOCKET_PATCH_REQUIRE_DOCKER gate (set nowhere), the dead run_in_image and npm's unused Duration import. Every agent suite's skip now honours SOCKET_PATCH_DOCKER_E2E_REQUIRED like the sbt and vendor suites. CI sets it only on legs whose images it builds, so no CI leg changes outcome. Refs #1968 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Assisted-by: Claude Code:claude-opus-5-5
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 22c76cc. Configure here.
|
Ready for review at
Generated by Claude Code |
Final review briefWhat it does: Adds a shared Risk: low. I compared every deleted copy line by line with the shared code. The images, docker flags (sbt keeps Look here:
Verified: I read the full diff against #1968. Changes I made: none. Open questions / nits (non-blocking, for the follow-up slices):
Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
Wenxin Jiang (Wenxin-Jiang)
left a comment
There was a problem hiding this comment.
[agent] Reviewed 22c76cc86f38c0d8f4e0be42971dbcda0fb31a87. Checked shared Docker image gates, coverage mounts, execution flags and agent VEX assertions against migrated suites. No major correctness issues found. Validation: source and regression-test review plus the available exact-head CI checks; no local test pass is claimed.
LLM Description written by Claude Code:claude-opus-5-5
Refs #1968 (register T60, living document Part 5). This is the first slice. The issue stays open for the rest (listed under "Remaining").
Why
Each
docker_e2e_*suite carried its own copy of the container scaffolding. 9 copies ofcov_docker_argsand 8 ofassert_vex_agent_attestedwere byte-identical (md5-checked), andskip_if_no_imagehad drifted: 7 copies never read the required switch, and deno readSOCKET_PATCH_REQUIRE_DOCKER, which nothing sets.Changes (test-only)
tests/docker_common/mod.rs, the one home for:cov_docker_args, with sbt'sSOCKET_PATCH_DOCKER_BINbranch folded in;skip_if_no_image(image)/skip_or_require_image, moved fromdocker_vendor_common;run_container(image, script);assert_vex_agent_attested(stdout, purl, ghsa).cov_docker_args×10, countingdocker_vendor_commonand sbt'sbinary_mounts;skip_if_no_image×10, counting npm'sskip_if_no_docker_imageand sbt'srequired();run_container×5 and npm'srun_in_container;docker runblocks in cargo, golang and maven;assert_vex_agent_attested×8;plain_sha256×3 and pypi'ssha256_hex(usecommon::sha256_hex).SOCKET_PATCH_REQUIRE_DOCKERgate;docker_vendor_common::run_in_image;Durationimport and itsconst _suppressor.docker_vendor_commonbuilds itsdocker runoncrate::docker_common::cov_docker_args. Its includers (5 vendor suites,docker_e2e_npm,tests/vendor/main.rs) also declaredocker_common. The selftest importsskip_or_require_imagefrom there.Diff: +260 / −1,113, all in tests (net −853). No production lines change.
Behavior
The required gate. Every agent suite now honours
SOCKET_PATCH_DOCKER_E2E_REQUIRED=1the way sbt and the vendor capstones already did. The variable is set only for:sbt)arm of both docker jobs;composer-compatibility.yml, which runs onlydocker_e2e_vendor_composer;scripts/sbt-compat-matrix.sh, which runs onlydocker_e2e_sbt.So no CI leg changes outcome.
SOCKET_PATCH_DOCKER_BIN. It now overrides the binary in every suite, not only in sbt. Onlysbt-compat-matrix.shsets it.Skip messages. Their wording is now uniform. npm's no-docker message no longer mentions
SOCKET_PATCH_TEST_HOST, which the module doc still documents.Verification
docker_e2e_*binaries build and pass with--features docker-e2e. Without images, the container tests skip and the host-side tests run: 17–31 per binary.tests/vendor'sdocker_vendor_commonselftests pass 8/8, includinga_required_docker_suite_fails_on_a_missing_image.cargo clippy --workspace --all-features -- -D warningsis clean.coverage-docker/e2e-dockerjobs, so this needs a full-scope CI dispatch to prove them./code-review high
It raised 10 findings. None were fixed, for these reasons:
SOCKET_PATCH_REQUIRE_DOCKER. This is intended (Share one docker test harness: cov_docker_args ×10, skip_if_no_image ×11 and assert_vex_agent_attested ×8 are copied, and 8 docker suites never honour SOCKET_PATCH_DOCKER_E2E_REQUIRED #1968, step 3): nothing sets the variable, and the shared gate readsSOCKET_PATCH_DOCKER_E2E_REQUIRED.SOCKET_PATCH_DOCKER_BINnow applies everywhere and skips the coverage mounts. Its only setter runs sbt alone, so it keeps sbt's precedence.run_containertakes no extra args. Folding in sbt (-m 2g,-e),docker_vendor_common::docker_commandand npm's vlt smoke needs anextraparameter. That is left for the follow-up, together with items 6 and 7.host.docker.internalURL ×15 andapi_url_for_container×2: follow-up.assert_api_path_exercised×4, drifted: follow-up, as the issue'sassert_api_exercised.crate::docker_commonis a crate-root requirement. A missing declaration fails compilation at that line.docker image inspectruns per test. That was already the case and is cheap.ci.ymlcomment names the per-suite files.ci.ymlis left alone because ci-janitor PRs Retry pinned bundler installs in the e2e legs #1854 and Annotate failing tests in macOS/Windows test legs #1890 change it.Remaining on #1968
ci.yml;assert_api_exercisedand container URL;GIT_SHA256_FNcopies ×3 →git_blob_sha;"applied": 1greps →assert_summary(gem matches10);run_containerwith extra args.Risk
Low to medium. The change is test-only and compile-checked, but the docker containers can't run in this sandbox.
🤖 Generated with Claude Code
https://claude.ai/code/session_011f9aeP9dHgNGnDr1A5rmCp
Note
Low Risk
Changes are confined to integration tests and shared test modules; production code is untouched, with minor env-gate alignment that the PR notes should not alter current CI legs.
Overview
Introduces
tests/docker_common/mod.rsas the shared home for Docker integration-test plumbing, and wires everydocker_e2e_*(and vendor suites that already used overlapping helpers) through it instead of copy-pasted locals.Consolidated helpers:
cov_docker_args(now also honorsSOCKET_PATCH_DOCKER_BINbefore coverage mounts),skip_if_no_image/skip_or_require_image,run_container(image, script), andassert_vex_agent_attested(stdout, purl, ghsa)with an explicit GHSA argument.docker_vendor_commondrops its duplicate skip/coverage logic and callscrate::docker_common::cov_docker_args; the unusedrun_in_imagehelper is removed.Suite cleanup: Per-file duplicates of coverage mounts, skip gates, container runners, VEX oracles, and local
plain_sha256/ pypisha256_hexare deleted in favor ofcommon::sha256_hex. Agent suites pass anIMAGEconstant into the shared skip/run APIs; sbt swapsbinary_mountsforcov_docker_args.Intentional test behavior alignment: All agent docker suites now respect
SOCKET_PATCH_DOCKER_E2E_REQUIRED=1(replacing deno’s unusedSOCKET_PATCH_REQUIRE_DOCKERgate). Skip messaging is unified (npm no longer mentions host mode in the skip line).Reviewed by Cursor Bugbot for commit 22c76cc. Configure here.
Generated by Claude Code