Skip to content

feat(docker): add Dockerfile for running the test suite without local PHP (closes #674) - #772

Merged
s2x merged 4 commits into
masterfrom
feat/issue-674-provide-a-dockerfile-for-running-the-tes
Aug 22, 2026
Merged

feat(docker): add Dockerfile for running the test suite without local PHP (closes #674)#772
s2x merged 4 commits into
masterfrom
feat/issue-674-provide-a-dockerfile-for-running-the-tes

Conversation

@s2x

@s2x s2x commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Description

Closes #674

Changes

  • Dockerfile (repo root) — self-contained test image on php:8.2-cli-bookworm with pcntl, posix, zip, inotify, pcov, phar.readonly=0, pcov.directory=/app/src, memory_limit=512M and Composer. Mirrors the most restrictive CI leg (PHP 8.2 + Symfony 6.4, PCOV coverage).
  • docker-entrypoint.sh (repo root) — fixes named-volume ownership (wmb-var, wmb-vendor are root-owned by default) by chowning as root, then drops to the non-root app user via runuser.
  • .dockerignore — excludes vendor/, var/, .git, .pi-subagents/, e2e/vendor/, e2e/build/, composer.lock, tool caches.
  • bin/docker-test — shell helper wrapping the bind-mount run with named volumes; supports --build and --build-arg KEY=VALUE (both space and equals forms).
  • CONTRIBUTING.md — new "Running tests in Docker (no local PHP needed)" subsection with build/run commands, in-container ports note (8888/9999/9991, no -p needed), macOS/Linux UID caveat.
  • bin/README.mddocker-test entry.
  • CHANGELOG.md — entry under existing ### Added in [Unreleased].

Changelog

Added: Dockerfile + .dockerignore + docker-entrypoint.sh + bin/docker-test for running the test suite in Docker without local PHP/extensions.

Proof of Work

docs/proof_of_work/0674-dockerfile-test-suite/ — 2 review rounds (round 1 found 4 findings F-1..F-4, all fixed and verified in round 2)

Code Review

  • Passed subagent code review (2 rounds)
  • Every finding answered (F-1: fixed, F-2: fixed, F-3: fixed, F-4: fixed)

Piotr Hałas added 3 commits August 22, 2026 22:42
… PHP (closes #674)

- Dockerfile on php:8.2-cli-bookworm with pcntl, posix, zip, inotify, pcov,
  phar.readonly=0, pcov.directory=/app/src and Composer — mirrors the most
  restrictive CI leg (PHP 8.2 + Symfony 6.4, PCOV coverage)
- .dockerignore excludes vendor/, var/, .git, .pi-subagents/, e2e/vendor/,
  e2e/build/, composer.lock, tool caches
- bin/docker-test helper wraps the bind-mount run with named volumes
- CONTRIBUTING.md documents the Docker workflow + macOS/Linux UID caveat
- F-1: remove duplicated apt-get update in Dockerfile
- F-2: add docker-entrypoint.sh that chowns named volumes (wmb-var, wmb-vendor)
  as root then drops to app user via runuser; fixes var/cache/dev write failure
- F-3: fix --build-arg parser in bin/docker-test to accept space-separated form
  (--build-arg KEY=VALUE) as documented, not just --build-arg=KEY=VALUE
- F-4: add memory_limit=512M to php.ini drop-in; suite needs ~150MB, php:*-cli
  defaults to 128M

Also: update CHANGELOG entry to mention entrypoint and memory_limit,
record review round 1 findings
All round 1 findings (F-1..F-4) verified as fixed. No new issues.
Implementation ready for PR.
@s2x s2x self-assigned this Aug 22, 2026
…::$trustedHosts

Symfony 6.4.44+ replaced the per-host append in Request::getHost() with a
single trustedHostsRegexp preg_match, so Request::$trustedHosts is never
populated. Tests that asserted on its count now use the bundle's own
validatedHosts cache (validatedHostsCacheCount), which is the authoritative
bounded structure and exists on all supported Symfony versions.
@s2x
s2x merged commit 930eaf2 into master Aug 22, 2026
14 checks passed
@s2x
s2x deleted the feat/issue-674-provide-a-dockerfile-for-running-the-tes branch August 22, 2026 21: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] Provide a Dockerfile for running the test suite without local PHP/extensions

1 participant