Skip to content

Commit

Permalink
test: optimize codecov config (apache#13329)
Browse files Browse the repository at this point in the history
* test: optimize codecov config to let GitHub checks always pass

* Run tests on workflow changes, too
  • Loading branch information
ktmud authored Feb 25, 2021
1 parent 94d0bb9 commit d39bc14
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
codecov:
notify:
after_n_builds: 4
ignore:
- "superset/migrations/versions/*.py"
coverage:
status:
project:
informational: true
default:
# Commits pushed to master should not make the overall
# project coverage decrease:
target: auto
threshold: 0%
patch:
informational: true
default:
threshold: 0%
9 changes: 3 additions & 6 deletions .github/workflows/bashlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,6 @@ cypress-run-all() {

cypress-run "*/**/*"

# Upload code coverage separately so each page can have separate flags
# -c will clean existing coverage reports, -F means add flags
# || true to prevent CI failure on codecov upload
codecov -cF "cypress" || true

# After job is done, print out Flask log for debugging
say "::group::Flask log for default run"
cat "$flasklog"
Expand All @@ -211,8 +206,10 @@ cypress-run-all() {

cypress-run "sqllab/*" "Backend persist"

# Upload code coverage separately so each page can have separate flags
# -c will clean existing coverage reports, -F means add flags
# || true to prevent CI failure on codecov upload
codecov -cF "cypress" || true
codecov -c -F "cypress" || true

say "::group::Flask log for backend persist"
cat "$flasklog"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superset-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
if: steps.check.outcome == 'failure'
working-directory: ./superset-frontend
run: |
bash <(curl -s https://codecov.io/bash) -cF javascript
bash <(curl -s https://codecov.io/bash) -c -F javascript
4 changes: 2 additions & 2 deletions .github/workflows/superset-python-presto-hive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Upload code coverage
if: steps.check.outcome == 'failure'
run: |
bash <(curl -s https://codecov.io/bash) -cF python
bash <(curl -s https://codecov.io/bash) -c -F python -F presto
test-postgres-hive:
if: github.event.pull_request.draft == false
Expand Down Expand Up @@ -158,4 +158,4 @@ jobs:
- name: Upload code coverage
if: steps.check.outcome == 'failure'
run: |
bash <(curl -s https://codecov.io/bash) -cF python
bash <(curl -s https://codecov.io/bash) -c -F python -F hive
6 changes: 3 additions & 3 deletions .github/workflows/superset-python-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Upload code coverage
if: steps.check.outcome == 'failure'
run: |
bash <(curl -s https://codecov.io/bash) -cF python
bash <(curl -s https://codecov.io/bash) -c -F python -F mysql
test-postgres:
if: github.event.pull_request.draft == false
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
- name: Upload code coverage
if: steps.check.outcome == 'failure'
run: |
bash <(curl -s https://codecov.io/bash) -cF python
bash <(curl -s https://codecov.io/bash) -c -F python -F postgres
test-sqlite:
if: github.event.pull_request.draft == false
Expand Down Expand Up @@ -190,4 +190,4 @@ jobs:
- name: Upload code coverage
if: steps.check.outcome == 'failure'
run: |
bash <(curl -s https://codecov.io/bash) -cF python
bash <(curl -s https://codecov.io/bash) -c -F python -F sqlite
4 changes: 2 additions & 2 deletions scripts/ci_check_no_file_changes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ REGEXES=()
for CHECK in "$@"
do
if [[ ${CHECK} == "python" ]]; then
REGEX="(^tests\/|^superset\/|^setup\.py|^requirements\/.+\.txt)"
REGEX="(^\.github\/workflows\/.*python|^tests\/|^superset\/|^setup\.py|^requirements\/.+\.txt)"
echo "Searching for changes in python files"
elif [[ ${CHECK} == "frontend" ]]; then
REGEX="(^superset-frontend\/)"
REGEX="(^\.github\/workflows\/.*(frontend|e2e)|^superset-frontend\/)"
echo "Searching for changes in frontend files"
else
echo "Invalid check: \"${CHECK}\". Falling back to exiting with FAILURE code"
Expand Down

0 comments on commit d39bc14

Please sign in to comment.