kylekatarnls/multi-tester
Run unit tests across multiple Composer projects after changing a shared package. Multi-tester swaps your local package into dependent projects’ vendor dirs and runs their test suites (Travis CI-style supported), catching integration breakages early.
illuminate/, spatie/) and PHP’s vendor/ structure, reducing integration friction.*.multi-tester.yml) aligns with Laravel’s modular philosophy (e.g., service providers, packages). Supports versioned testing (e.g., Laravel 9.x vs. 11.x) via SemVer constraints.phpunit, pest). Reduces pipeline complexity by consolidating cross-project tests into a single job.dev dependency, non-intrusive to production. No Laravel service provider or Facade required—pure CLI tool.replace key in composer.json (critical for monorepos like laravel/framework).allow-plugins (e.g., Laravel’s laravel/installer).psr-4 paths in composer.json).jobs:
multi-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: composer require kylekatarnls/multi-tester --dev
- run: vendor/bin/multi-tester --config=.multi-tester.laravel.yml
| Risk | Mitigation |
|---|---|
| Dependency Graph Complexity | Use --stop-on-failure to fail fast; validate composer.lock consistency. |
| CI Resource Overhead | Parallelize tests via matrix in GitHub Actions or Travis job arrays. |
| False Positives/Negatives | Combine with Laravel’s phpunit --filter to isolate test suites. |
| Laravel-Specific Bugs | Test against laravel/framework first; use symfony/symfony as a proxy. |
| Configuration Drift | Store .multi-tester.yml in repo; use pre-commit hooks to validate syntax. |
illuminate/support, spatie/laravel-permission)?laravel/) requiring replace-key handling?#[\Override]) in tested packages?multi-tester block merges (GitHub PR checks) or warn only?phpunit --debug)?.multi-tester.yml updates? (Devs, QA, or a shared config repo?)laravel/valet)?laravel/framework, illuminate/, or spatie/ packages against downstream users.# .multi-tester.laravel.yml
laravel/framework:11.x:
clone: git clone https://github.com/laravel/framework.git .
install: composer install --prefer-dist --no-interaction
script: vendor/bin/phpunit --testsuite=Unit
stop_on_failure: true
spatie/laravel-permission:5.*:
travis: true # Auto-pulls from .travis.yml
vendor/ structure.tightenco/ziggy against Laravel 10.x–11.x.nunomaduro/collision).illuminate/support + spatie/laravel-permission).--add to auto-generate .multi-tester.yml:
vendor/bin/multi-tester --add=illuminate/support
- name: Run multi-tester
if: github.event_name == 'push' || github.event_name == 'pull_request'
run: vendor/bin/multi-tester --config=.multi-tester.laravel.yml --stop-on-failure
MULTITEST env var as shown in the README.laravel/framework:10.*, laravel/framework:11.*).php: matrix in CI.composer.json scripts to trigger multi-tester:
"scripts": {
"test:multi": "multi-tester --config=.multi-tester.laravel.yml --verbose"
}
| Component | Compatibility |
|---|---|
| Laravel Versions | 9.x–11.x (tested via laravel/framework versions). |
| PHP Versions | 8.1–8.3 (drop PHP 7.1 support aligns with Laravel’s minimum). |
| Composer | Supports Composer 2.x (default) and Packagist v2 API. |
| GitHub Actions | Native support; no additional setup needed. |
| Travis CI | Pre-configured; uses standard before_script/script phases. |
| Monorepos | Handles replace keys (e.g., laravel/framework’s internal dependencies). |
| Custom Scripts | Supports travis shortcut for .travis.yml commands. |
multi-tester after phpunit in CI:
composer test → phpunit → multi-tester
jobs:
multi-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: composer install
- run: vendor/bin/multi-tester --stop-on-failure
strategy:
matrix:
laravel: [10.x, 11.x]
multi-tester fails, revert the change and investigate with:
vendor/bin/multi-tester --verbose --debug
.multi-tester.yml in the root of the package repo or a shared config repo for multi-package projects.# templates/multi-tester.laravel.yml
laravel/framework:{{version}}:
clone: git clone https://github.com/laravel/framework.git .
install: composer install --prefer-dist --no-interaction
script: vendor/bin
How can I help you explore Laravel packages today?