Skip to content

Commit caa231d

Browse files
committed
Fix codecov flags to show different coverage for regular vs scheduled runs
Previously, scheduled runs uploaded coverage to both 'regular' and 'scheduled' flags, causing both to show identical coverage percentages. Now each flag is updated exclusively by its respective run type: - 'regular': Updated only by PR runs (subset tests) - 'scheduled': Updated only by scheduled runs (full test suite) This allows the 'scheduled' flag to properly reflect coverage from scheduled_only tests, which should be higher than the 'regular' flag. Updated codecov.yml comments to accurately document this behavior. Or a shorter version if preferred: Fix codecov to upload to separate flags for PR vs scheduled runs Scheduled runs now upload only to 'scheduled' flag instead of both 'regular,scheduled'. This ensures the flags reflect their respective test suites: regular (PR subset) vs scheduled (full suite including scheduled_only tests).
1 parent 05bf24c commit caa231d

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/run_tests_against_package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,6 @@ jobs:
133133
with:
134134
token: ${{ secrets.CODECOV_TOKEN }}
135135
file: ./coverage.xml
136-
# If scheduled, upload to BOTH flags. If PR, upload ONLY to regular.
137-
flags: ${{ inputs.is_scheduled_run == 'true' && 'regular,scheduled' || 'regular' }}
136+
# If scheduled, upload to scheduled flag only. If PR, upload to regular flag only.
137+
flags: ${{ inputs.is_scheduled_run == 'true' && 'scheduled' || 'regular' }}
138138
verbose: true

codecov.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
# limitations under the License.
1414

1515
# MaxText Codecov Configuration
16-
#
16+
#
1717
# We use a two-flag scheme ('regular' and 'scheduled') to handle our tiered test suite.
18-
# 'carryforward' is enabled because Pull Requests only run a subset of tests (excluding 'scheduled_only').
19-
# Without it, PRs would show a significant coverage drop as they would 'overwrite' the full-suite results.
18+
# 'carryforward' is enabled because each flag is only updated by its respective run type.
2019
#
2120
# Scheme:
22-
# - 'regular': Updated by every PR. Used to evaluate 'patch' (new code) coverage.
23-
# - 'scheduled': Updated by scheduled full runs. Used to anchor 'project' (total health) coverage.
21+
# - 'regular': Updated ONLY by PRs (subset of tests, excluding 'scheduled_only'). Used for 'patch' coverage.
22+
# - 'scheduled': Updated ONLY by scheduled runs (all tests including 'scheduled_only'). Used for 'project' coverage.
2423
# During PRs, the 'scheduled' flag is carried forward from the last full run on 'main' to keep the score stable.
24+
# During scheduled runs, the 'regular' flag is carried forward from the last PR.
2525

2626
# Exclude non-source code, deprecated and experimental folders from coverage tracking
2727
codecov:
@@ -43,10 +43,10 @@ ignore:
4343

4444

4545
flags:
46-
# Updated on every PR and during every scheduled run (contains a subset of tests).
46+
# Updated ONLY by PRs (contains subset of tests, excluding scheduled_only).
4747
regular:
4848
carryforward: true
49-
# Updated ONLY during scheduled runs (contains all tests).
49+
# Updated ONLY by scheduled runs (contains all tests including scheduled_only).
5050
scheduled:
5151
carryforward: true
5252

0 commit comments

Comments
 (0)