mozex/laravel-test-lanes
A Laravel package for splitting your test suite into balanced lanes so PHPUnit or Pest tests can run in parallel across CI jobs, reducing total test time while keeping lane workloads predictable and easy to configure.
Architecture fit. laravel-test-lanes is a test-parallelization package for Laravel that partitions MySQL/Postgres databases into per-worker “lanes” so concurrent PHPUnit/Pest runs don’t collide. It sits in the dev-tooling layer of a Laravel codebase — no runtime coupling, no production risk, no schema changes. Fit is good for teams that already run parallel tests and struggle with database contention, and it is broadly applicable to any Laravel app using a relational DB in CI.
Integration feasibility. Low effort. Install as a dev dependency, publish config, provision test databases, and wire test-lanes into CI or a local test script. The 1.2.1 release is entirely a documentation and hardening patch — no new configuration surface, no migrations, no API changes — so prior usage patterns are unaffected. The most notable technical change is that max_connections sizing now accounts for every connection a worker opens rather than assuming two; that is a correctness improvement that may surface under-provisioned database max_connections settings that previously appeared fine.
Technical risk.
test-lanes:cleanup --connection will drop lane databases on non-default connections even while tests are running on them, because lane locking is scoped to the default connection’s database. This is a real risk for teams running multi-connection test suites; it needs to be encoded as a CI guardrail, not just a docs note.test-lanes:cleanup from a shell reads DB_DATABASE from .env and finds no lanes unless DB_DATABASE=app_testing is set explicitly. This is a usability trap, not a package bug — but it is a support-ticket generator if the team doesn’t document it internally.Key questions.
--connection cleanup must be banned in CI.max_connections ceiling, and does it accommodate the now-correct per-worker count?DB_DATABASE set explicitly in shell scripts and CI steps that invoke test-lanes:cleanup?Stack fit. Works with standard Laravel testing (PHPUnit or Pest) against MySQL or Postgres. Dev dependency only — no impact on the deployable artifact, no Composer runtime footprint in production. Compatible with GitHub Actions, GitLab CI, and local Docker-based test environments.
Migration path. Straightforward for teams already using php artisan test --parallel or similar: add the package, publish config, create lane databases, replace the test invocation with test-lanes, and set max_connections on the DB server consistent with the new sizing rule. For greenfield adoption, add it as part of the initial CI test harness rather than retrofitting. No data migration, no application code changes.
Compatibility. 1.2.1 is a patch on 1.2.0 with no breaking API surface. Backwards-compatible with existing 1.2.x configuration. The only behavioral change is the more conservative max_connections estimate, which is a safety improvement but may require provisioning changes if servers were tuned to the old “two connections per worker” assumption.
Sequencing.
max_connections using the corrected per-worker count.composer.json (dev).test-lanes:cleanup --connection in CI; require explicit DB_DATABASE= on shell cleanup invocations.Maintenance. Low. Dev-only package, patch-level upgrades, single maintainer (mozex) — so version-pinning and periodic review of changelogs is advisable rather than blindly floating on ^1.2. The 1.2.1 release being docs-heavy is a signal that the maintainer is actively tightening guidance, which is a positive maturity indicator.
Support. Minimal end-user support burden since the package is internal-facing. The main support load will be engineer onboarding questions about lane databases and the cleanup semantics — mitigated by internal runbooks covering the DB_DATABASE= requirement and the --connection ban.
Scaling. Scales with CI parallelism up to the database server’s connection ceiling. The corrected max_connections calculation in 1.2.1 makes this ceiling more predictable; teams should size DB instances against lane count × connections-per-worker rather than the older two-connection rule of thumb. For very high lane counts, a dedicated test DB instance or containerized per-job databases is preferable to a shared server.
Failure modes.
--connection cleanup.DB_DATABASE.max_connections — now more likely to surface as an explicit failure post-1.2.1, which is desirable but should be anticipated during rollout.Ramp-up. Roughly half a day for an engineer familiar with Laravel and CI to install, configure lanes, and validate a parallel run. Half a day more to establish internal runbook notes covering the cleanup caveats and cache semantics introduced/clarified in 1.2.1. No specialized database administration knowledge required beyond max_connections tuning.
How can I help you explore Laravel packages today?