-
Notifications
You must be signed in to change notification settings - Fork 122
HelpersTask597_Configure_Codecov_for_coverage #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gpsaggese
merged 66 commits into
master
from
HelpersTask597_Configure_Codecov_for_coverage
May 2, 2025
Merged
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
eea3a1c
testing
Shaunak01 5d29501
testing
Shaunak01 f6eb29d
testing
Shaunak01 d33dd79
testing
Shaunak01 bd3cf41
testing
Shaunak01 fac66d6
testing
Shaunak01 0c20303
testing
Shaunak01 a5a72bb
testing
Shaunak01 7b7e2f1
testing
Shaunak01 07aaefd
testing
Shaunak01 c41a94c
checkpoint
Shaunak01 48f52e9
checkpoint
Shaunak01 36e14e7
Merge branch 'master' into HelpersTask597_Configure_Codecov_for_coverage
Shaunak01 5068411
Merge branch 'master' into HelpersTask597_Configure_Codecov_for_coverage
dremdem a3495b7
checkpoint
Shaunak01 8e5071f
Merge branch 'HelpersTask597_Configure_Codecov_for_coverage' of githu…
Shaunak01 3166f88
Merge branch 'master' into HelpersTask597_Configure_Codecov_for_coverage
Shaunak01 714698b
test with superslow
Shaunak01 75c96d1
Merge branch 'HelpersTask597_Configure_Codecov_for_coverage' of githu…
Shaunak01 de3b70f
test
Shaunak01 ff2bb19
test
Shaunak01 927dbfc
test
Shaunak01 bbecbf7
test
Shaunak01 335366f
flag test
Shaunak01 04b7e00
flag test
Shaunak01 609b0d2
flag test
Shaunak01 e31fcee
test
Shaunak01 22a063f
test
Shaunak01 f56b038
test
Shaunak01 e9bf42a
test
Shaunak01 6dd275d
checkpoint
Shaunak01 0ff65c1
test
Shaunak01 67f4c9f
test
Shaunak01 988d1ad
test
Shaunak01 f532944
checkpoint
Shaunak01 0bbaadf
test
Shaunak01 7e82eb4
test
Shaunak01 6c6b587
test
Shaunak01 bac6d0b
test
Shaunak01 374b8af
test
Shaunak01 4fea59d
checkpoint
Shaunak01 bbba10f
checkpoint
Shaunak01 61aa34e
Merge branch 'master' into HelpersTask597_Configure_Codecov_for_coverage
dremdem f824084
test
Shaunak01 56033fa
Merge branch 'HelpersTask597_Configure_Codecov_for_coverage' of githu…
Shaunak01 8992d8a
test
Shaunak01 0b3e8e8
checkpoint
Shaunak01 af9b90b
test
Shaunak01 1e8850e
test
Shaunak01 0aba958
test
Shaunak01 d5f3b3f
test
Shaunak01 aaf03b4
test
Shaunak01 feb3d05
test
Shaunak01 b8e5bf3
debug
Shaunak01 e9ce5bf
test
Shaunak01 760786d
test
Shaunak01 0af1914
test
Shaunak01 023f94e
checkpoint
Shaunak01 1d7701c
checkpoint
Shaunak01 b6c70fa
Merge branch 'master' into HelpersTask597_Configure_Codecov_for_coverage
dremdem cf00538
Test
Shaunak01 8c202ca
Merge branch 'HelpersTask597_Configure_Codecov_for_coverage' of githu…
Shaunak01 8becd02
Test
Shaunak01 0d0e75a
Test
Shaunak01 ca1dacb
Checkpoint
Shaunak01 697e7bc
Merge branch 'master' into HelpersTask597_Configure_Codecov_for_coverage
Shaunak01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[report] | ||
# Glob pattern(s) of files to omit from the report. | ||
omit = | ||
*/devops/compose/* | ||
*/helpers/test/outcomes/*/tmp.scratch/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
boto3 >= 1.20.17 | ||
coverage | ||
invoke | ||
tqdm | ||
s3fs | ||
boto3 >= 1.20.17 | ||
tqdm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
name: Test coverage | ||
|
||
on: | ||
workflow_dispatch: {} | ||
Shaunak01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# every day at 00:00 UTC. | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
env: | ||
CSFY_CI: true | ||
|
||
permissions: | ||
# Required to authenticate and retrieve temporary AWS credentials via OIDC. | ||
id-token: write | ||
# Required to fetch and check out code from the repository. | ||
contents: read | ||
# Required to authenticate and pull Docker images from GitHub Container Registry (GHCR). | ||
packages: read | ||
|
||
|
||
jobs: | ||
run_test_coverage: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: ${{ vars.GH_ACTION_AWS_ROLE_ARN }} | ||
role-session-name: ${{ vars.GH_ACTION_AWS_SESSION_NAME }} | ||
aws-region: ${{ vars.CSFY_AWS_DEFAULT_REGION }} | ||
|
||
- name: Login to GHCR | ||
run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Cleanup | ||
run: sudo chmod 777 -R . | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update PYTHONPATH | ||
run: echo "PYTHONPATH=.:helpers" >> $GITHUB_ENV | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r .github/gh_requirements.txt | ||
|
||
- name: Pull image from GHCR | ||
run: docker pull ghcr.io/${{ github.repository }}:dev | ||
|
||
# Only on scheduled runs, capture ISO weekday (1=Mon … 7=Sun). | ||
- name: Set DAY_OF_WEEK | ||
if: github.event_name == 'schedule' | ||
run: echo "DAY_OF_WEEK=$(date -u +'%u')" >> $GITHUB_ENV | ||
|
||
# This step is used to trigger the fast test coverage generation using the invoke task. | ||
- name: Run Fast test and generate report | ||
id: run_fast | ||
continue-on-error: true | ||
Shaunak01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
echo "Simulating fast test failure" | ||
Shaunak01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
exit 1 | ||
# env: | ||
# GH_ACTION_ACCESS_TOKEN: ${{ secrets.GH_ACTION_ACCESS_TOKEN }} | ||
# CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} | ||
# CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} | ||
# CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }} | ||
# CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }} | ||
# CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner }} | ||
# CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }} | ||
# run: invoke run_coverage --suite fast | ||
|
||
- name: Upload Fast Test Coverage to Codecov | ||
id: upload_fast | ||
# Only upload if the previous fast test run step succeeded (i.r report generated). | ||
# failed step don’t generate a coverage report, so there's nothing to upload. | ||
if: steps.run_fast.outcome == 'success' | ||
continue-on-error: true | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
# Specify the Codecov flag name associated with this test suite. | ||
# Required to separate coverage reports by type (e.g., fast, slow, superslow) inside the Codecov UI. | ||
flags: fast | ||
name: fast-test-coverage | ||
|
||
- name: Run Slow test and generate report | ||
id: run_slow | ||
continue-on-error: true | ||
env: | ||
GH_ACTION_ACCESS_TOKEN: ${{ secrets.GH_ACTION_ACCESS_TOKEN }} | ||
CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} | ||
CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} | ||
CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }} | ||
CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }} | ||
CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner }} | ||
CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }} | ||
run: invoke run_coverage --suite slow | ||
|
||
- name: Upload Slow Test Coverage to Codecov | ||
id: upload_slow | ||
# Only upload if the previous slow test run step succeeded (i.r report generated). | ||
if: steps.run_slow.outcome == 'success' | ||
continue-on-error: true | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
flags: slow | ||
name: slow-test-coverage | ||
|
||
- name: Run Superslow test and generate report | ||
# Run only on scheduled jobs or manual trigger | ||
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | ||
Shaunak01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
GH_ACTION_ACCESS_TOKEN: ${{ secrets.GH_ACTION_ACCESS_TOKEN }} | ||
CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} | ||
CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} | ||
CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }} | ||
CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }} | ||
CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner }} | ||
CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }} | ||
run: | | ||
# Only run superslow tests if it's Monday or a manual dispatch. | ||
day_of_week=$(date +%u) | ||
if [ "$day_of_week" = "1" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||
invoke run_coverage --suite superslow | ||
else | ||
echo "Skipping superslow tests — not Monday and not manually triggered" | ||
exit 0 | ||
fi | ||
|
||
- name: Upload Superslow Test Coverage to Codecov | ||
#TODO(Shaunak): Consider removing it when we turn this workflow into a reusable one. | ||
if: steps.run_superslow.outcome == 'success' | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
flags: superslow | ||
name: superslow-test-coverage | ||
|
||
# Fail the job in CI if any of the fast/ slow run/ upload steps above failed. | ||
- name: Fail if fast/slow test or upload failed | ||
Shaunak01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
failed="" | ||
if [ "${{ steps.run_fast.outcome }}" != "success" ]; then | ||
echo "Fast test run failed" | ||
failed="true" | ||
fi | ||
if [ "${{ steps.upload_fast.outcome }}" != "success" ]; then | ||
echo "Fast test coverage upload failed" | ||
failed="true" | ||
fi | ||
if [ "${{ steps.run_slow.outcome }}" != "success" ]; then | ||
echo "Slow test run failed" | ||
failed="true" | ||
fi | ||
if [ "${{ steps.upload_slow.outcome }}" != "success" ]; then | ||
echo "Slow test coverage upload failed" | ||
failed="true" | ||
fi | ||
if [ "$failed" = "true" ]; then | ||
echo "At least one fast/slow test or upload step failed." | ||
exit 1 | ||
fi |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.