Skip to content

Commit

Permalink
ci: Remove changes outside codecov_ats.yml
Browse files Browse the repository at this point in the history
Changes introduced to `backend.yml` and the `test-python-ci` target
are being removed.

This is because there was evidence that using `--cov-context=test` in pytest
would incur a 22% (median) increase in CI time. That was deemed unacceptable.

However Codecov's Automated Test Selection still needs this data to be able
to correlate test execution and coverage information with the test that
generated that coverage.

The agreed upon solution will be a periodic job to collect coverage info in
the master branch and a cheaper job to carryforward coverage reports for
all new commits in the master branch.

These changes will be made in a separate PR.
  • Loading branch information
giovanni-guidini committed Oct 18, 2023
1 parent d82deac commit edc3b76
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,8 @@ jobs:
pg-version: ${{ matrix.pg-version }}

- name: Run backend test (${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }})
# The coverage json command creates a different format of coverage report
# That is used to power Codecov Automated Test Selection
# (see .github/workflows/codecov_ats.yml)
run: |
make test-python-ci
coverage json -o .artifacts/python.coverage.json --show-contexts
# Upload coverage data even if running the tests step fails since
# it reduces large coverage fluctuations
Expand All @@ -116,23 +112,6 @@ jobs:
uses: ./.github/actions/artifacts
with:
token: ${{ secrets.CODECOV_TOKEN }}
# This is temporary because codecov/codecov-action@v4-beta
# Doesn't support --disable-search option
# And we don't want to upload random reports (for safety)
- name: Clean state of uploads - special case to test Codecov ATS
if: ${{ always() }}
run: rm .artifacts/python.coverage.xml
continue-on-error: true
- name: Upload coverage - special case to test Codecov ATS
if: ${{ always() }}
uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: .artifacts/python.coverage.codecov.json
flags: smart-tests
plugins: compress-pycoverage
continue-on-error: true

backend-migration-tests:
if: needs.files-changed.outputs.backend == 'true'
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ test-js-ci: node-version-check
@yarn run test-ci
@echo ""

# --cov-context=test is used to annotate what tests are being executed in the coverage info
# And it's used to power Codecov Automated Test Selection
# (see .github/workflows/codecov_ats.yml)
test-python-ci: create-db
@echo "--> Running CI Python tests"
pytest \
Expand All @@ -136,7 +133,7 @@ test-python-ci: create-db
tests/sentry \
tests/sentry_plugins \
tests/symbolicator \
--cov . --cov-report="xml:.artifacts/python.coverage.xml" --cov-context=test
--cov . --cov-report="xml:.artifacts/python.coverage.xml"
@echo ""


Expand Down

0 comments on commit edc3b76

Please sign in to comment.