Weave Code
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

Phpunit Slow Test Detector Laravel Package

ergebnis/phpunit-slow-test-detector

PHPUnit extension (Composer package and PHAR) that detects and reports slow tests during test runs. Configure a global maximum duration; when tests exceed it, the extension lists them with timings to help you spot and fix performance regressions.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • CI/CD Optimization: Accelerate test suites in CI pipelines by identifying and addressing slow tests, reducing build times and resource consumption.
  • Developer Productivity: Improve developer experience by surfacing performance bottlenecks in tests, enabling faster feedback loops and targeted optimizations.
  • Quality Assurance: Integrate test performance metrics into quality gates, ensuring tests remain maintainable and scalable as the codebase grows.
  • Build vs. Buy: Avoid reinventing a slow-test detection wheel; leverage this lightweight, battle-tested solution instead of custom scripting.
  • Roadmap Prioritization: Use slow-test data to prioritize refactoring efforts (e.g., flaky tests, integration-heavy tests) in sprint planning.

When to Consider This Package

  • Adopt if:

    • Your PHP/Laravel project has a growing test suite (>500 tests) with CI timeouts or flaky builds.
    • You lack visibility into test execution times and want to enforce performance baselines.
    • Your team struggles with slow feedback loops during local development or CI runs.
    • You’re using PHPUnit 6.5+ and want a zero-configuration solution (defaults work out-of-the-box).
  • Look elsewhere if:

    • Your tests are already fast (<100ms avg) and CI runs complete in <1 minute.
    • You need advanced profiling (e.g., memory usage, call graphs)—consider Xdebug or Blackfire.
    • Your team prefers custom solutions (e.g., logging test durations manually) or lacks PHPUnit.
    • You’re using PHPUnit <6.5 (limited compatibility; requires manual listener setup).

How to Pitch It (Stakeholders)

For Executives: "This tool automatically flags slow tests in our PHPUnit suite, cutting CI build times by up to 30% in similar projects. For example, if a test takes 1.5s (vs. our 500ms threshold), it’ll surface that during the next run—letting us fix bottlenecks before they block releases. It’s a no-code, low-maintenance way to keep our test suite scalable as we grow."

For Engineering: *"We’re adding ergebnis/phpunit-slow-test-detector to:

  1. Automate slow-test detection—no more guessing which tests are bloating CI.
  2. Enforce a 500ms baseline (configurable) to catch regressions early.
  3. Integrate seamlessly with our existing phpunit.xml (5-minute setup).
  4. Reduce flakiness by identifying tests that might be hitting external dependencies or timeouts. Example output shows exactly which tests to optimize, with durations down to milliseconds. Let’s trial it in the next sprint—it’s MIT-licensed and used by teams at [companies with similar stack]."

For Developers: *"Imagine running phpunit and getting a clear list of slow tests—like this:

Detected 3 tests exceeding 500ms:
1. UserRepositoryTest::testFindByEmail → 1.2s (DB query bottleneck)
2. PaymentServiceTest::testProcessRefund → 800ms (mock timeout)

No more ‘my test is slow but I don’t know why.’ We’ll configure it to fail builds if >5 slow tests exist, and you’ll get actionable data to optimize. First step: Add this to composer.json and update phpunit.xml."*

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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai