Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Test Lanes Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  • Operational foot-guns around cleanup. The 1.2.1 notes explicitly warn that 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.
  • Shell-context confusion. Running 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.
  • Shared state between concurrent runs. The release clarifies that lanes leave shared state between concurrent runs — notably a per-checkout test-impact cache such as Pest’s Tia. This replaces the previous “fan out freely” guidance and implies that test-impact analysis or cache-based test selection can be incorrect under concurrent lane execution unless the cache is partitioned or disabled. This is the highest-impact technical note in the release.
  • Low blast radius. Dev-only dependency; worst case is slow or flaky CI, not production incidents.

Key questions.

  1. Do we use test-impact analysis (Pest Tia, PHPUnit cache, or custom) that would be corrupted by concurrent lane runs sharing a cache?
  2. Are we running tests against more than one database connection? If yes, --connection cleanup must be banned in CI.
  3. What is the database server’s max_connections ceiling, and does it accommodate the now-correct per-worker count?
  4. Is DB_DATABASE set explicitly in shell scripts and CI steps that invoke test-lanes:cleanup?
  5. How many lanes (workers) are we targeting, and does that fit the DB server’s connection budget?

Integration Approach

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.

  1. Inventory current test parallelism method and any test-impact caches (Pest Tia, PHPUnit result cache).
  2. Decide cache strategy: partition per lane, disable during lane runs, or accept the shared-cache semantics documented in 1.2.1.
  3. Provision database max_connections using the corrected per-worker count.
  4. Pin 1.2.1 in composer.json (dev).
  5. Encode guardrails: forbid test-lanes:cleanup --connection in CI; require explicit DB_DATABASE= on shell cleanup invocations.
  6. Roll out to one repo first, then template to others.

Operational Impact

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.

  • Cross-connection lane drop during active tests — mitigated by CI policy against --connection cleanup.
  • Cleanup silently no-ops — mitigated by requiring explicit DB_DATABASE.
  • Under-provisioned max_connections — now more likely to surface as an explicit failure post-1.2.1, which is desirable but should be anticipated during rollout.
  • Stale test-impact cache causing false negatives — the release’s most consequential clarification; requires an intentional decision on cache handling under concurrency.
  • Maintainer bandwidth — single-maintainer project; mitigate with version pinning.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console