## Summary - add Spec 288 no-legacy route/helper and provider-core/role-authority guard coverage - extend the pinned Spec 281 and Spec 285 browser smokes plus lane/report classification wording for classification-only fallout handling - add the Spec 288 artifact package and contributor-facing quality-gate guidance while keeping Package Execution deferred to Spec 289 ## Validation - `export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && REPO_ROOT="$(git rev-parse --show-toplevel)" && (cd "$REPO_ROOT/apps/platform" && ./vendor/bin/sail artisan test --compact tests/Feature/Guards/Spec288NoLegacyRouteAndHelperGuardTest.php tests/Feature/Guards/Spec288ProviderCoreAndRoleAuthorityGuardTest.php tests/Feature/Guards/AdminWorkspaceRoutesGuardTest.php tests/Feature/Guards/ProviderBoundaryPlatformCoreGuardTest.php tests/Feature/ProviderConnections/LegacyRedirectTest.php tests/Feature/ManagedEnvironment/LegacyTenantCoreGuardTest.php tests/Feature/Spec080WorkspaceManagedTenantAdminMigrationTest.php tests/Feature/Rbac/ProviderConnectionWorkspaceFirstPolicyTest.php tests/Feature/Filament/ManagedEnvironmentAccessScopeManagementTest.php tests/Feature/Guards/BrowserLaneIsolationTest.php tests/Feature/Guards/CiLaneFailureClassificationContractTest.php tests/Feature/Guards/CiHeavyBrowserWorkflowContractTest.php tests/Unit/Auth/NoRoleStringChecksTest.php)` - `export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && REPO_ROOT="$(git rev-parse --show-toplevel)" && (cd "$REPO_ROOT/apps/platform" && ./vendor/bin/sail artisan test --compact tests/Browser/Spec281ProviderConnectionScopeSmokeTest.php tests/Browser/Spec285WorkspaceRbacEnvironmentAccessSmokeTest.php)` - `export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && REPO_ROOT="$(git rev-parse --show-toplevel)" && (cd "$REPO_ROOT/apps/platform" && ./vendor/bin/sail bin pint --dirty --format agent)` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #347
97 lines
3.7 KiB
PHP
97 lines
3.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Tests\Support\TestLaneBudget;
|
|
use Tests\Support\TestLaneReport;
|
|
|
|
it('classifies wrapper or manifest drift before lower-level lane failures', function (): void {
|
|
$primaryFailureClassId = TestLaneReport::classifyPrimaryFailure(
|
|
exitCode: 1,
|
|
artifactPublicationStatus: ['complete' => true],
|
|
budgetOutcome: ['budgetStatus' => 'over-budget'],
|
|
entryPointResolved: false,
|
|
workflowLaneMatched: false,
|
|
);
|
|
|
|
expect($primaryFailureClassId)->toBe('wrapper-failure');
|
|
});
|
|
|
|
it('keeps confidence budget overruns visible without converting them into blocking failures', function (): void {
|
|
$budgetOutcome = TestLaneBudget::evaluateLaneForTrigger('confidence', 'mainline-push', 481.0);
|
|
$summary = TestLaneReport::buildCiSummary(
|
|
report: [
|
|
'laneId' => 'confidence',
|
|
'budgetStatus' => 'within-budget',
|
|
'ciContext' => ['workflowId' => 'main-confidence'],
|
|
],
|
|
exitCode: 0,
|
|
budgetOutcome: $budgetOutcome,
|
|
artifactPublicationStatus: ['complete' => true, 'publishedArtifacts' => []],
|
|
);
|
|
|
|
expect($budgetOutcome['budgetStatus'])->toBe('over-budget')
|
|
->and($summary['primaryFailureClassId'])->toBe('budget-breach')
|
|
->and($summary['blockingStatus'])->toBe('non-blocking-warning');
|
|
});
|
|
|
|
it('treats mature fast-feedback budget overruns as blocking when they exceed the CI tolerance', function (): void {
|
|
$budgetOutcome = TestLaneBudget::evaluateLaneForTrigger('fast-feedback', 'pull-request', 216.0);
|
|
$summary = TestLaneReport::buildCiSummary(
|
|
report: [
|
|
'laneId' => 'fast-feedback',
|
|
'budgetStatus' => 'within-budget',
|
|
'ciContext' => ['workflowId' => 'pr-fast-feedback'],
|
|
],
|
|
exitCode: 0,
|
|
budgetOutcome: $budgetOutcome,
|
|
artifactPublicationStatus: ['complete' => true, 'publishedArtifacts' => []],
|
|
);
|
|
|
|
expect($budgetOutcome['budgetStatus'])->toBe('over-budget')
|
|
->and($summary['primaryFailureClassId'])->toBe('budget-breach')
|
|
->and($summary['blockingStatus'])->toBe('blocking');
|
|
});
|
|
|
|
it('classifies incomplete artifact bundles independently from test and budget status', function (): void {
|
|
$summary = TestLaneReport::buildCiSummary(
|
|
report: [
|
|
'laneId' => 'fast-feedback',
|
|
'budgetStatus' => 'within-budget',
|
|
'ciContext' => ['workflowId' => 'pr-fast-feedback'],
|
|
],
|
|
exitCode: 0,
|
|
budgetOutcome: null,
|
|
artifactPublicationStatus: [
|
|
'complete' => false,
|
|
'publishedArtifacts' => [],
|
|
],
|
|
);
|
|
|
|
expect($summary['primaryFailureClassId'])->toBe('artifact-publication-failure')
|
|
->and($summary['blockingStatus'])->toBe('blocking');
|
|
});
|
|
|
|
it('surfaces classification-only scope boundaries for heavy governance and browser reports', function (): void {
|
|
$heavySummary = TestLaneReport::buildCiSummary(
|
|
report: [
|
|
'laneId' => 'heavy-governance',
|
|
'budgetStatus' => 'within-budget',
|
|
'ciContext' => ['workflowId' => 'heavy-governance-manual'],
|
|
],
|
|
exitCode: 1,
|
|
artifactPublicationStatus: ['complete' => true, 'publishedArtifacts' => []],
|
|
);
|
|
$browserSummary = TestLaneReport::buildCiSummary(
|
|
report: [
|
|
'laneId' => 'browser',
|
|
'budgetStatus' => 'within-budget',
|
|
'ciContext' => ['workflowId' => 'browser-manual'],
|
|
],
|
|
exitCode: 1,
|
|
artifactPublicationStatus: ['complete' => true, 'publishedArtifacts' => []],
|
|
);
|
|
|
|
expect($heavySummary['scopeBoundaryNote'])->toContain('full-suite repair ownership')
|
|
->and($browserSummary['scopeBoundaryNote'])->toContain('classification-only');
|
|
}); |