Skip to content

feat(docker): parallel test runs across git worktrees without port conflicts (closes #676) - #775

Merged
s2x merged 5 commits into
masterfrom
feat/issue-676-run-the-dockerized-test-suite-in-paralle
Aug 23, 2026
Merged

feat(docker): parallel test runs across git worktrees without port conflicts (closes #676)#775
s2x merged 5 commits into
masterfrom
feat/issue-676-run-the-dockerized-test-suite-in-paralle

Conversation

@s2x

@s2x s2x commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Description

Closes #676

Changes

  • bin/docker-test-worktree (new): runs composer test/test:coverage/lint for any git worktree in its own container of the workerman-bundle-test image. Each container has its own network namespace, so N parallel worktree suites cannot collide on ports 8888/9999/9991 — no -p, no code change. Container name (wmb-<worktree-basename>) and vendor volume (wmb-vendor-<worktree-basename>) are unique per checkout; var/ stays in the worktree's own bind mount. --publish starts ONLY the daemon with ephemeral host mappings (-p 127.0.0.1::8888|9999|9991), waits for all three ports to accept in-container, prints the mappings, and blocks until Ctrl-C/TERM (trap removes the container). Readiness failure is loud: prints a docker logs --tail 20 excerpt and removes the container.
  • tests/App/Kernel.php: the three listen addresses honour WMB_LISTEN_ADDR (default 127.0.0.1 — unset behavior is byte-identical), required for the publish flow so forwarded host connections reach the bridge interface.
  • CONTRIBUTING.md: new "Parallel test runs across git worktrees" subsection (network-namespace guarantee, never-share-var/ rule, per-worktree vendor volumes, publish/curl debug flow); the outdated ports note now lists all three ports and documents WMB_LISTEN_ADDR.
  • Cross-environment cache poisoning guard: the helper purges var/cache/dev/workerman/config.cache.php* at startup — a cache written inside the container holds /app-prefixed paths that crash host runs with mkdir(): Read-only file system, and vice versa a host-written cache trips the container-side ownership guard.

Changelog

Two entries under \[Unreleased\] → Added (helper + docs; WMB_LISTEN_ADDR).

Proof of Work

docs/proof_of_work/0676-docker-worktree-parallel-tests/ — 3 review rounds

Code Review

  • Passed subagent code review
  • Every finding answered

@s2x s2x self-assigned this Aug 23, 2026
@s2x
s2x merged commit c3e79e1 into master Aug 23, 2026
14 checks passed
@s2x
s2x deleted the feat/issue-676-run-the-dockerized-test-suite-in-paralle branch August 23, 2026 09:19
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.

[Enhancement] Run the Dockerized test suite in parallel across git worktrees without port conflicts

1 participant