testo/bench
Benchmark plugin for Testo. Runs benchmark methods repeatedly, records per-iteration timings, and reports descriptive statistics plus warnings for variance, outliers, and noisy environments—ideal for tracking performance alongside correctness tests.
actingAs(), followRedirects()) within benchmark methods.@bench or extends BenchmarkTestCase, requiring minimal changes to existing test classes.use Testo\Bench\BenchmarkTestCase;
use Illuminate\Support\Facades\Http;
class ApiBenchmark extends BenchmarkTestCase {
public function test_payment_processing() {
Http::fake();
$response = Http::post('/pay', ['amount' => 100]);
$this->assertLessThan(1000, $response->time()); // <1s threshold
}
}
self-hosted runners).@bench annotations vs. separate test classes)?benchmarks/ directory)?testo/bench:
composer require --dev testo/testo testo/bench
BenchmarkTestCase:
// Before (PHPUnit)
public function test_api_response() {
$response = Http::get('/api/data');
$this->assertLessThan(500, $response->time());
}
// After (Testo Bench)
use Testo\Bench\BenchmarkTestCase;
class ApiBenchmark extends BenchmarkTestCase {
public function test_api_response_time() {
$response = Http::get('/api/data');
$this->assertTimeLessThan(500); // Built-in benchmark assertion
}
}
- name: Run Benchmarks
run: vendor/bin/testo --filter="*Benchmark" --env=ci
benchmarks/ directory.concurrency: 2 for parallel execution).Http facade.DB::connection()->getPdo().BenchmarkTestCase to test job execution times.actingAs() within benchmark methods.| Phase | Task | Dependencies | Owner |
|---|---|---|---|
| 1 | Install Testo + Bench | Composer access | DevOps/Backend |
| 2 | Pilot Benchmark (1–2 tests) | Existing test suite | QA/Backend |
| 3 | CI/CD Integration | GitHub Actions/GitLab CI | DevOps |
| 4 | Baseline Storage | Git/LFS or artifact storage | DevOps |
| 5 | Alerting Setup | Slack/PagerDuty integration | DevOps/SRE |
| 6 | Scale to Critical Paths | Test coverage analysis | Backend/QA |
composer update).How can I help you explore Laravel packages today?