Skip to content

Commit 7f39d85

Browse files
committed
Always run nyc report after CT tests so frontend coverage uploads on red CT runs
`test:coverage:ct` chained `playwright test ... && nyc report ...`, so a failing CT run short-circuited before `nyc report` could turn the per-test JSON files in .nyc_output into an lcov.info. The downstream "Upload CT Coverage to Codecov" step (if: success() || failure()) then errored with "No coverage reports found" and frontend-component did not upload for that SHA. Codecov's server-side aggregation of the merged `frontend` flag was left with only frontend-unit (~23%) and frontend-e2e (~24%), pulling the merged number down to ~33% even though the previous commit was at ~67% — observed on six consecutive main commits 2026-04-26T01:02.. 02:58Z (2d7033f..be5bcfc) before recovering on 3029839 once CT started passing again. Mirror the existing test:e2e:coverage pattern: ; CT_EXIT=$?; nyc report ... || echo "No coverage data to report"; exit $CT_EXIT so nyc report runs regardless of test outcome and the lcov ships even on red CT runs. frontend-component will still report a slightly lower number when tests fail (failed tests register fewer hits), but it will report — keeping the merged frontend flag's denominator stable.
1 parent 6bd7f26 commit 7f39d85

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111

12+
- **Merged `frontend` Codecov flag drops to ~33% on every commit where Frontend CI's CT job fails** (`frontend/package.json` `test:coverage:ct`): the script chained `playwright test ... && mkdir -p ... && nyc report ...`, so a failing CT run short-circuited before `nyc report` could turn the per-test JSON files in `.nyc_output` into an `lcov.info`. The downstream `Upload CT Coverage to Codecov` step (`if: success() || failure()`) then errored with "No coverage reports found" and `frontend-component` did not upload for that SHA. Codecov's server-side aggregation of the `frontend` flag was left with only `frontend-unit` (~23%) and `frontend-e2e` (~24%), pulling the merged number down to ~33% even though the previous commit was at ~67% — observed on six consecutive main commits 2026-04-26T01:02..02:58Z (`2d7033f8`..`be5bcfc8`) before recovering on `30298391`. Mirrored the existing `test:e2e:coverage` pattern (`; CT_EXIT=$?; nyc report ... || echo "No coverage data to report"; exit $CT_EXIT`) so `nyc report` runs regardless of test outcome and the lcov ships even on red CT runs. `frontend-component` will still report a slightly lower number when tests fail (failed tests register fewer hits), but it will report — keeping the merged `frontend` flag's denominator stable.
1213
- **`User.__init__` shared-state mutation re-introduced by branch merge** (`opencontractserver/users/models.py:172-180` removed): PR #1374 (commit `50ed6740`) deleted the `User.__init__` override that mutated `Field.validators[0]` on every instantiation, but a subsequent merge (`b68c1cb4 → 6d2cddbf`) resurrected the override along with its mypy-narrowing changes. The current main on commit `6d2cddbf` therefore reproduced the original `#1358` bug: `User(...)` rebound `username_field.validators[0]` and clobbered any third-party validator prepended to the list. Removed the `__init__` override entirely; the class-body declaration `validators=[UserUnicodeUsernameValidator()]` on the `username` field (still present from PR #1374) is the canonical and only declaration. Also dropped the now-unused `Field` import. Regression coverage from PR #1374 (`opencontractserver/tests/test_user_username_validator.py`) was already on main and is what surfaced the regression in CI.
1314

1415
### Security

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"test:e2e": "playwright test",
101101
"test:e2e:coverage": "COVERAGE=true playwright test; E2E_EXIT=$?; mkdir -p coverage/e2e/.nyc_output && nyc report --all --reporter=lcov --reporter=text --report-dir=coverage/e2e --temp-dir=coverage/e2e/.nyc_output || echo 'No coverage data to report'; exit $E2E_EXIT",
102102
"test:coverage:unit": "vitest run --coverage --watch=false",
103-
"test:coverage:ct": "COVERAGE=true playwright test -c playwright-ct.config.ts --reporter=list && mkdir -p coverage/ct/.nyc_output && nyc report --all --reporter=lcov --reporter=text --report-dir=coverage/ct --temp-dir=coverage/ct/.nyc_output",
103+
"test:coverage:ct": "COVERAGE=true playwright test -c playwright-ct.config.ts --reporter=list; CT_EXIT=$?; mkdir -p coverage/ct/.nyc_output && nyc report --all --reporter=lcov --reporter=text --report-dir=coverage/ct --temp-dir=coverage/ct/.nyc_output || echo 'No coverage data to report'; exit $CT_EXIT",
104104
"lint": "prettier . --check --ignore-unknown",
105105
"fix-styles": "prettier . --check --write --ignore-unknown",
106106
"prepare": "cd .. && husky install frontend/.husky",

0 commit comments

Comments
 (0)