Skip to content

Commit

Permalink
Merge pull request #6036 from FileMagic/fix_st2_codecov
Browse files Browse the repository at this point in the history
Use codecov-cli over python-codecov
  • Loading branch information
cognifloyd authored Oct 23, 2023
2 parents 4d58a17 + 337e427 commit d374b92
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ jobs:

env:
TASK: '${{ matrix.task }}'

PYTHON_VERSION_SHORT: '${{ matrix.python-version-short }}'
NODE_TOTAL: '${{ matrix.nosetests_node_total }}'
NODE_INDEX: '${{ matrix.nosetests_node_index }}'

Expand Down Expand Up @@ -478,9 +478,11 @@ jobs:
./scripts/ci/run-nightly-make-task-if-exists.sh "${TASK}"
- name: Codecov
# NOTE: We only generate and submit coverage report for master and version branches and only when the build succeeds (default on GitHub Actions, this was not the case on Travis so we had to explicitly check success)
if: "${{ success() && (env.ENABLE_COVERAGE == 'yes') }}"
if: "${{ success() && (env.ENABLE_COVERAGE == 'yes') && (env.PYTHON_VERSION_SHORT == '3.8')}}"
run: |
./scripts/ci/submit-codecov-coverage.sh
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

integration-tests:
needs: pre_job
Expand Down Expand Up @@ -606,7 +608,7 @@ jobs:

env:
TASK: '${{ matrix.task }}'

PYTHON_VERSION_SHORT: '${{ matrix.python-version-short }}'
NODE_TOTAL: '${{ matrix.nosetests_node_total }}'
NODE_INDEX: '${{ matrix.nosetests_node_index }}'

Expand Down Expand Up @@ -715,9 +717,11 @@ jobs:
script -e -c "make ${TASK}" && exit 0
- name: Codecov
# NOTE: We only generate and submit coverage report for master and version branches and only when the build succeeds (default on GitHub Actions, this was not the case on Travis so we had to explicitly check success)
if: "${{ success() && env.ENABLE_COVERAGE == 'yes' && env.TASK == 'ci-integration' }}"
if: "${{ success() && (env.ENABLE_COVERAGE == 'yes') && (env.TASK == 'ci-integration') && (env.PYTHON_VERSION_SHORT == '3.8')}}"
run: |
./scripts/ci/submit-codecov-coverage.sh
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Compress Service Logs Before upload
if: ${{ failure() && env.TASK == 'ci-integration' }}
run: |
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Fixed

* Avoid logging sensitive information in debug (fix #5977)

* Fix codecov stackstorm/st2 (https://github.com/StackStorm/st2/issues/6035)

Added
~~~~~

Expand Down
File renamed without changes.
13 changes: 5 additions & 8 deletions scripts/ci/submit-codecov-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@
# If we're on Travis, then we need to manually check that the build succeeded.
if [[ "${USER}" == "runner" || ${TRAVIS_TEST_RESULT} -eq 0 ]]; then
# 1. Install codecov dependencies
# NOTE: We need eventlet installed so coverage can be correctly combined. This is needed because we are covering code which utilizes eventlet.
# Without eventlet being available to the coverage command it will fail with "Couldn't trace with concurrency=eventlet, the module isn't installed."
pip install eventlet
# NOTE: codecov only supports coverage==4.5.2
pip install 'coverage<5.0'
pip install "codecov==2.1.11"
pip install -U pip
pip install coverage
pip install codecov-cli>=0.3.2

# 2. Combine coverage report and submit coverage report to codecovs.io
codecov --required
# 2. Combine coverage report and submit coverage report to codecov.io
codecovcli upload-process -t "${CODECOV_TOKEN}"
exit $?
else
echo "Build has failed, not submitting coverage"
Expand Down
3 changes: 1 addition & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# NOTE: codecov only supports coverage==4.5.2
coverage==4.5.2
coverage
pep8==1.7.1
st2flake8==0.1.0
astroid==2.5.6
Expand Down

0 comments on commit d374b92

Please sign in to comment.