Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ phpqa/
### 1. Image Docker (`Dockerfile`)

Image Docker construite en deux étapes (`php:X.Y-cli` pour compiler, `debian:slim` à l'exécution) avec :
- Uniquement les outils QA appelés par les tâches Castor (PHPStan, ECS, Rector, Deptrac, PHPUnit, Infection, parallel-lint, Mago)
- Uniquement les outils QA appelés par les tâches Castor (PHPStan, ECS, Rector, Deptrac, PHPUnit, ParaTest, Infection, parallel-lint, Mago)
- Castor pré-installé (binaire statique)
- Les extensions PHP nécessaires aux projets Symfony/Doctrine
- Le layout `/tools/.composer/vendor-bin/...` hérité de `jakzal/phpqa`, référencé par les projets
Expand Down
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,22 @@ COPY <<EOF /tools/.composer/vendor-bin/infection/composer.json
}
EOF

# paratest runs the test files in parallel processes and merges the coverage of its workers itself,
# which is what sharding a suite across CI jobs cannot do: PHPUnit does not merge XML coverage
# reports from several runs. It is a Composer package and needs phpunit/phpunit in its own vendor
# tree, which is usually what makes it awkward beside a PHAR; this tree already holds one, pulled by
# the extensions it exists for.
#
# "^7" rather than a precise version, because the PHP of the build is what decides: paratest 7.26
# asks for PHP 8.4 and PHPUnit 13.4, 7.20 for PHP 8.3 and PHPUnit 12.5, 7.8 for PHP 8.2 and PHPUnit
# 11.5. Composer resolves the newest that runs here, and the PHPUnit it brings is the newest that
# runs here too, which is the same bound the PHAR loop further down uses to pick /tools/phpunit. So
# the Composer PHPUnit of this tree and that PHAR land on the same version on every PHP the image is
# built for, and pinning either one is what would make them disagree.
COPY <<EOF /tools/.composer/vendor-bin/phpunit/composer.json
{
"require": {
"brianium/paratest": "^7",
"digitalrevolution/phpunit-extensions": "^1.13",
"ergebnis/phpunit-slow-test-detector": "^2.24",
"symfony/browser-kit": "^6.4|^7.0|^8.0",
Expand All @@ -143,7 +156,8 @@ RUN set -eux; \
ln -s /tools/.composer/vendor-bin/phpstan/vendor/bin/phpstan /tools/phpstan; \
ln -s /tools/.composer/vendor-bin/ecs/vendor/bin/ecs /tools/ecs; \
ln -s /tools/.composer/vendor-bin/rector/vendor/bin/rector /tools/rector; \
ln -s /tools/.composer/vendor-bin/infection/vendor/bin/infection /tools/infection
ln -s /tools/.composer/vendor-bin/infection/vendor/bin/infection /tools/infection; \
ln -s /tools/.composer/vendor-bin/phpunit/vendor/bin/paratest /tools/paratest

# ------------------------------------------------------------
# PHAR tools + Castor
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This repository provides:

1. **🐳 Lean Docker Image** (~800 MB, ~150 MB compressed) built on the official `php:X.Y-cli` images with:
- ✅ Only the QA tools used by the Castor tasks (PHPStan, ECS, Rector, Deptrac, PHPUnit, Infection, parallel-lint, Mago)
- ✅ Only the QA tools used by the Castor tasks (PHPStan, ECS, Rector, Deptrac, PHPUnit, ParaTest, Infection, parallel-lint, Mago)
- 🛠️ [Castor](https://github.com/jolicode/castor) pre-installed as a task runner (static build, works on every PHP version)
- 🧩 The PHP extensions needed by Symfony/Doctrine projects (intl, pdo_pgsql, redis, amqp, imagick, xdebug, ...)
- 🧪 Enhanced PHPUnit, PHPStan, and Infection tooling
Expand Down Expand Up @@ -123,6 +123,7 @@ ship its own copy in `vendor/bin`:
| `rector` | `/tools/.composer/vendor-bin/rector` |
| `infection` | `/tools/.composer/vendor-bin/infection` |
| `deptrac`, `composer normalize` | `/tools/.composer/vendor` |
| `paratest` (parallel PHPUnit, merges the coverage of its workers) | `/tools/.composer/vendor-bin/phpunit` |
| PHPUnit helpers (slow test detector, foundry, browser-kit, ...) | `/tools/.composer/vendor-bin/phpunit` |
| `phpunit-10` … `phpunit-13` (PHAR), `phpunit` → newest one supported by the PHP version | `/tools` |
| `parallel-lint` (PHAR) | `/tools` |
Expand Down
Loading