8.8 KiB
Quickstart: Test Suite Governance & Performance Foundation
Goal
Establish a fast default contributor run, a broader confidence run that owns the non-browser feature or integration middle path, dedicated browser and heavy-governance lanes, visible slow-test reporting, and cheap shared defaults for the most widely used fixture paths.
Implementation Order
- Introduce the checked-in lane manifest or equivalent selector map that combines suites, directories, groups, and explicit files.
- Add the checked-in lane command entry points for fast-feedback, confidence, browser, heavy-governance, profiling, and JUnit reporting.
- Align the default contributor run with fast-feedback and define the confidence lane as the Unit suite plus the manifest-defined non-browser Feature or Integration selectors outside explicit heavy-governance exclusions.
- Seed the heavy-governance lane only with the obvious initial families, such as browser-adjacent governance scans, architecture, deprecation, and the first obvious guard-heavy clusters.
- Wire artifact output to
storage/logs/test-lanesand emit a budget-aware summary for each reporting path. - Add focused guard tests that verify browser exclusion, valid lane declarations, confidence-lane scope, and stable report semantics.
- Run the first serial profiling pass and capture the current full-suite baseline plus the first measured lane baselines.
- Refine the heavy-governance selectors from the profiling evidence and publish the initial runtime budgets.
- Split
createUserWithTenant()into a cheap default profile and an explicit heavy or provider-enabled profile. - Introduce minimal and heavy states for the next most expensive factory or fixture cluster touched in this slice.
- Audit the obvious taxonomy misfits surfaced during rollout and reclassify or regroup the first batch.
- Document the honest taxonomy rules, DB reset strategy, seed restrictions, and deferred schema-baseline evaluation rules.
Suggested Code Touches
apps/platform/composer.json
apps/platform/phpunit.xml
apps/platform/phpunit.pgsql.xml
apps/platform/tests/Pest.php
apps/platform/tests/TestCase.php
apps/platform/tests/Feature/Guards/*
apps/platform/tests/Architecture/*
apps/platform/tests/Deprecation/*
apps/platform/tests/Feature/OpsUx/*
apps/platform/tests/Browser/*
apps/platform/tests/Support/*
apps/platform/database/factories/*
scripts/platform-test-lane
scripts/platform-test-report
Validation Flow
After the checked-in commands exist, validate the end-state workflow with the canonical repo-root wrappers:
./scripts/platform-test-lane fast-feedback
./scripts/platform-test-lane confidence
./scripts/platform-test-lane heavy-governance
./scripts/platform-test-lane browser
./scripts/platform-test-lane profiling
./scripts/platform-test-lane junit
./scripts/platform-test-report fast-feedback
./scripts/platform-test-report confidence
./scripts/platform-test-report heavy-governance
./scripts/platform-test-report browser
./scripts/platform-test-report profiling
./scripts/platform-test-report junit
cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent
The app-local Sail Composer commands remain valid, but the repo-root wrapper is the safer default for long lanes because it forces Composer to run with --timeout=0.
During implementation, keep the feedback loop tight by running the most relevant focused suites first:
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Guards
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Unit
cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Browser
cd apps/platform && ./vendor/bin/sail artisan test --compact -c phpunit.pgsql.xml
Recorded Baselines
These measurements were captured from the checked-in lane wrappers on the standard local Sail environment used for Spec 206 rollout.
| Scope | Wall clock | Budget | Status |
|---|---|---|---|
| Full suite baseline | 2624.60s |
reference only | Baseline anchor for lane targets |
fast-feedback |
176.74s |
200s |
Within budget and more than 50% below the full-suite baseline |
confidence |
394.38s |
450s |
Within budget and below the full-suite baseline |
heavy-governance |
83.66s |
120s |
Within budget |
browser |
128.87s |
150s |
Within budget |
junit |
380.14s |
450s |
Within budget |
profiling |
2701.51s |
3000s |
Within budget for the intentional serial drift run |
The first budget-backed family thresholds are:
ops-ux-governance:120sbrowser-smoke:150s
Taxonomy and Fixture Rules
Unitowns isolated logic and helper coverage.Featureowns HTTP, Livewire, Filament, jobs, and non-browser integration slices.Browserowns only end-to-end browser smoke and workflow coverage.heavy-governanceowns the first intentionally expensive families:tests/Architecture,tests/Deprecation,tests/Feature/078,tests/Feature/090,tests/Feature/144,tests/Feature/OpsUx,tests/Feature/Filament/Alerts/AlertsKpiHeaderTest.php,tests/Feature/Guards/ActionSurfaceContractTest.php,tests/Feature/Guards/OperationLifecycleOpsUxGuardTest.php, andtests/Feature/ProviderConnections/CredentialLeakGuardTest.php.createUserWithTenant()defaults to the cheapminimalprofile.- Use
createMinimalUserWithTenant()for high-usage membership-focused callers. - Use
provider-enabled,credential-enabled,ui-context, orheavyonly when the test truly needs those side effects. - Default lanes stay on SQLite
:memory:plusRefreshDatabase. - The
Pgsqlsuite stays isolated for schema and foreign-key assertions. - Seeds stay opt-in. Do not make seeded state part of the default lane contract.
- Schema-baseline or dump acceleration remains follow-up work, not part of the first-slice lane contract.
Manual Review Checklist
- Confirm the default contributor command excludes browser and explicitly heavy governance families.
- Confirm the confidence command covers the Unit suite plus the manifest-defined non-browser Feature or Integration selectors while still excluding the browser lane and explicit heavy-governance exclusions, and that its measured runtime remains below the current full-suite baseline.
- Confirm each lane declaration records its purpose, intended audience, included families, excluded families, and ownership expectations.
- Confirm the profiling support-lane entry runs serially and emits a ranked view with at least the top 10 slowest entries through the shared reporting envelope.
- Confirm the JUnit support-lane entry writes machine-readable output under
storage/logs/test-lanesthrough the same manifest and report contract shape. - Confirm the cheap default shared helper path no longer provisions workspace, membership, credentials, provider connection state, session context, cache-clearing side effects, or UI context unless explicitly requested.
- Confirm at least one additional factory or fixture cluster exposes minimal versus heavy behavior explicitly.
- Confirm the documented lane budgets and family thresholds are visible in report output, are anchored to the recorded measurements above, preserve the fast-feedback target of at least 50% below the current full-suite baseline, and keep the confidence lane below the current full-suite baseline.
- Confirm the initial heavy-governance selector set was refined after the first profiling pass rather than locked purely from intuition.
- Confirm the first obvious taxonomy misfits were reclassified or regrouped instead of only being documented.
Exit Criteria
- The repo has a single fast default contributor run and separate confidence, browser, heavy, profile, and JUnit entry points, with profile and JUnit represented as support-lane entries in the shared manifest and report contract.
- Browser tests are not silently part of the fast path.
- The confidence lane is defined as the Unit suite plus the manifest-defined non-browser Feature or Integration selectors that remain outside explicit heavy-governance exclusions.
- Every lane declaration carries purpose, intended audience, included families, excluded families, and ownership expectations.
- Slow-test visibility and machine-readable reports are available through checked-in commands, including a report with at least the top 10 slowest entries and family-threshold evaluation.
- The dominant shared helper and at least one additional factory or fixture cluster have explicit cheap defaults.
- Runtime budgets and family thresholds are documented from the recorded baseline measurements above, including the fast-feedback target of at least 50% below the current full-suite baseline and the confidence target of staying below the current full-suite baseline, and DB strategy guidance is tied to the lane model.
- The first obvious taxonomy misfits have been reclassified or regrouped as part of the rollout.