TenantAtlas/apps/platform/tests/Feature/Guards/CiFastFeedbackWorkflowContractTest.php
Ahmed Darrazi 8144a3be78
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 7m2s
feat: implement spec 439 branch and evidence truth
2026-07-11 21:13:42 +02:00

32 lines
2.4 KiB
PHP

<?php
declare(strict_types=1);
use Tests\Support\TestLaneManifest;
it('wires the pull-request workflow only to the fast-feedback lane with the checked-in wrappers and artifact staging helper', function (): void {
$workflowProfile = TestLaneManifest::workflowProfile('pr-fast-feedback');
$workflowContents = (string) file_get_contents(repo_path($workflowProfile['filePath']));
expect(file_exists(repo_path($workflowProfile['filePath'])))->toBeTrue()
->and($workflowProfile['triggerClass'])->toBe('pull-request')
->and($workflowProfile['laneBindings'])->toBe(['fast-feedback'])
->and($workflowContents)->toContain('pull_request:')
->and($workflowContents)->toContain('permissions:')
->and($workflowContents)->toContain('actions: read')
->and($workflowContents)->toContain('contents: read')
->and($workflowContents)->toContain('opened', 'reopened', 'synchronize')
->and($workflowContents)->toContain('fetch-depth: 0')
->and($workflowContents)->toContain('TENANTATLAS_PR_TARGET: ${{ github.base_ref }}')
->and($workflowContents)->toContain('if [[ -z "${TENANTATLAS_PR_TARGET}" ]]')
->and($workflowContents)->toContain('git fetch origin "${TENANTATLAS_PR_TARGET}:refs/remotes/origin/${TENANTATLAS_PR_TARGET}"')
->and($workflowContents)->toContain('bash scripts/check-ui-productization-coverage "origin/${TENANTATLAS_PR_TARGET}" --pull-request-target="${TENANTATLAS_PR_TARGET}"')
->and($workflowContents)->not->toContain('git fetch origin dev', 'scripts/check-ui-productization-coverage origin/dev')
->and($workflowContents)->toContain('./scripts/platform-test-lane fast-feedback --workflow-id=pr-fast-feedback --trigger-class=pull-request')
->and($workflowContents)->toContain('TENANTATLAS_GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}')
->and($workflowContents)->toContain('./scripts/platform-test-report fast-feedback --workflow-id=pr-fast-feedback --trigger-class=pull-request --fetch-latest-history')
->and($workflowContents)->toContain('./scripts/platform-test-artifacts fast-feedback .gitea-artifacts/pr-fast-feedback --workflow-id=pr-fast-feedback --trigger-class=pull-request')
->and($workflowContents)->toContain('name: fast-feedback-artifacts')
->and($workflowContents)->not->toContain('confidence --workflow-id=pr-fast-feedback', 'heavy-governance', 'browser --workflow-id=pr-fast-feedback');
});