facile-it/paraunit
Run PHPUnit test suites faster by executing tests in parallel across multiple processes. Symfony-based CLI with Composer install, supports many PHPUnit/Symfony versions, and can collect code coverage in parallel (auto-picks best driver like PCOV/Xdebug).
phpunit.xml configuration).phpunit.xml can be extended to include Paraunit’s bootstrap extension (automatically suggested on first run).php artisan test can be replaced or augmented with paraunit run).DatabaseTransactions trait with caution).phpunit.xml (automatically added on first run). Risk: Configuration drift if the file is manually edited or version-controlled without awareness.phpunit.xml template and include a pre-commit hook to validate its presence.RefreshDatabase or DatabaseTransactions traits, but validate parallel safety (e.g., avoid shared in-memory state like Cache::remember).--chunk-size) can help, but may not fully mitigate.phpunit.xml, CI configs, and local development.--debug).phpunit command. Works with Laravel’s phpunit.xml and test helpers (e.g., createApplication()).artisan command structure. Can be aliased as php artisan paraunit via a custom artisan command.phpunit with vendor/bin/paraunit run in workflows. Example:
- run: vendor/bin/paraunit run --coverage-text --stop-on-failure
--cobertura for GitLab’s coverage visualization:
- vendor/bin/paraunit coverage --cobertura=coverage.cobertura.xml
Makefile target or artisan command for local parallel testing:
# Makefile
test:parallel:
vendor/bin/paraunit run --chunk-size=20 --debug
Phase 1: Evaluation
composer require --dev facile-it/paraunit
vendor/bin/paraunit run --test-suffix=Test --chunk-size=10
Phase 2: Configuration
phpunit.xml to include Paraunit’s bootstrap extension (automatically suggested on first run).phpunit with paraunit run).phpunit.xml snippet:
<phpunit ...>
<extensions>
<extension class="Facile\Paraunit\BootstrapExtension" />
</extensions>
<listeners>
<listener class="Facile\Paraunit\TestHook" />
</listeners>
</phpunit>
Phase 3: Adoption
--cobertura for GitLab).phpunit.xml includes the bootstrap extension.Phase 4: Optimization
--chunk-size based on CI machine resources (default: 20).--coverage-cache-warmup) for faster CI runs.--stop-on-* flags to fail fast (e.g., --stop-on-failure).| Component | Compatibility Notes |
|---|---|
| Laravel 9+ | Full support (PHPUnit 10+). |
| Laravel 8 | Partial (requires Paraunit <2.0). |
| PHPUnit 13 | Supported in Paraunit 2.8+. |
| Xdebug/Pcov | Preferred for coverage; PHPDbg falls back. |
| Database Drivers | Deadlock detection for PostgreSQL; MySQL/SQLite require manual isolation. |
| Custom Test Helpers | No conflicts if tests use Laravel’s traits (e.g., RefreshDatabase). |
phpunit with paraunit run (highest ROI).Makefile/artisan alias for convenience.^2.8) to avoid breaking changes.phpunit.xml may be manually edited, removing Paraunit’s bootstrap extension.How can I help you explore Laravel packages today?