mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 08:19:59 +00:00
ci: preserve fast test budget summary on failure
This commit is contained in:
@@ -132,7 +132,12 @@ jobs:
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
start_epoch=$(date +%s)
|
start_epoch=$(date +%s)
|
||||||
bun run test:fast
|
test_status=0
|
||||||
|
if bun run test:fast; then
|
||||||
|
test_status=0
|
||||||
|
else
|
||||||
|
test_status=$?
|
||||||
|
fi
|
||||||
end_epoch=$(date +%s)
|
end_epoch=$(date +%s)
|
||||||
elapsed_seconds=$((end_epoch - start_epoch))
|
elapsed_seconds=$((end_epoch - start_epoch))
|
||||||
|
|
||||||
@@ -150,6 +155,8 @@ jobs:
|
|||||||
echo "- Result: within budget." >> "$GITHUB_STEP_SUMMARY"
|
echo "- Result: within budget." >> "$GITHUB_STEP_SUMMARY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit "$test_status"
|
||||||
|
|
||||||
- name: Test slow bucket
|
- name: Test slow bucket
|
||||||
run: bun run test:slow
|
run: bun run test:slow
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ describe('push ci workflow', () => {
|
|||||||
expect(workflow).toContain("FAST_TEST_BUDGET_SECONDS: '90'");
|
expect(workflow).toContain("FAST_TEST_BUDGET_SECONDS: '90'");
|
||||||
expect(workflow).toContain('name: Test fast bucket with perf budget');
|
expect(workflow).toContain('name: Test fast bucket with perf budget');
|
||||||
expect(workflow).toContain('bun run test:fast');
|
expect(workflow).toContain('bun run test:fast');
|
||||||
|
expect(workflow).toContain('test_status=$?');
|
||||||
|
expect(workflow).toContain('exit "$test_status"');
|
||||||
expect(workflow).toContain('::warning::test:fast took ${elapsed_seconds}s');
|
expect(workflow).toContain('::warning::test:fast took ${elapsed_seconds}s');
|
||||||
expect(workflow).toContain('scripts/run-test-bucket.js');
|
expect(workflow).toContain('scripts/run-test-bucket.js');
|
||||||
expect(workflow).toContain('run: bun run test:slow');
|
expect(workflow).toContain('run: bun run test:slow');
|
||||||
|
|||||||
Reference in New Issue
Block a user