Skip to content

test: make Docker suites hermetic - #438

Closed
sbalabanov wants to merge 1 commit into
mainfrom
e2e-hermetic
Closed

test: make Docker suites hermetic#438
sbalabanov wants to merge 1 commit into
mainfrom
e2e-hermetic

Conversation

@sbalabanov

Copy link
Copy Markdown
Contributor

Summary

  • cross-compile container service binaries through Bazel and expose explicit Docker test-context filegroups
  • resolve Compose files only from declared runfiles and stage minimal temporary Docker build contexts
  • remove repository-root discovery plus MODULE.bazel / go.mod marker data dependencies
  • make Docker test targets declare network access and remove pre-build Make prerequisites
  • derive test image names from declared input contents to keep caching deterministic

Sandbox evaluation

The Docker suites already run under Bazel's sandboxed strategy (processwrapper-sandbox locally). I did not enable Bazel's experimental hermetic Linux sandbox globally: it omits the host root and would require nonportable mounts for the Docker CLI, plugin, socket, shared libraries, and certificate/config paths. The tests now get source inputs only through Bazel runfiles while retaining the host Docker boundary they inherently require.

Validation

  • make build
  • make test
  • make integration-test
  • make e2e-test
  • make lint
  • make check-tidy
  • make check-gazelle

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sbalabanov
sbalabanov marked this pull request as ready for review July 23, 2026 23:51
@sbalabanov
sbalabanov requested review from a team and behinddwalls as code owners July 23, 2026 23:51
@sbalabanov
sbalabanov marked this pull request as draft July 23, 2026 23:53
@sbalabanov

Copy link
Copy Markdown
Contributor Author

Closed in lieu of #439 , a separate PR will come to address fixes from here

@sbalabanov sbalabanov closed this Jul 27, 2026
sbalabanov pushed a commit that referenced this pull request Jul 28, 2026
…ilegroups

Summary:
Follow-ups to #439, adopting the stronger ideas from the concurrent implementation in #438.

Intent:
- #439 seeds the compose image-tag prefix from TEST_TARGET, which is identical across worktrees: two worktrees at different revisions running the same target against one Docker daemon can interleave builds and start a container from the other worktree's image. Derive the tag from the declared input contents instead, so a collision is impossible by construction.
- The cross-compiled service binaries and Dockerfiles were exported as public, non-testonly targets and enumerated file-by-file in every test's data list. Encapsulate them so they cannot leak into production targets.

Changes:
- Image-tag prefix is now a hash of the declared inputs (compose file + staged build-context files, hashed in deterministic order): identical inputs reuse the docker build cache, different revisions never collide on a tag.
- Each service bundles its docker build-context inputs (Dockerfile, configs, cross-compiled linux binary) into a testonly docker_test_context filegroup visible only to //test/...; the go_cross_binary targets are now private and the per-file Dockerfile/queues.yaml exports are gone.
- Build-context staging streams the copy and preserves the source file mode instead of loading whole binaries into memory and stamping everything 0755.

Test Plan:
- Ran //test/integration/submitqueue/gateway, //test/e2e/submitqueue, and //test/integration/extension/counter/mysql locally against a real Docker daemon (staged-context, multi-service, and no-build-context paths) and verified via `docker images` that image tags carry the content-hash prefix, with distinct prefixes per distinct input set.

---

<sub>Generated by the 🪄 [pr-create](https://sg.uberinternal.com/code.uber.internal/uber-code/devexp-agent-marketplace/-/blob/claude-code/plugins/dev/uber-dev/skills/pr-create/SKILL.md) skill in devexp-agent-marketplace</sub>

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

4 participants