Skip to content

Commit

Permalink
[nsidc_tests] Upload codecov report for tests requiring Earthdata login
Browse files Browse the repository at this point in the history
Move the codecov setup to the install step to reduce repetition, so that both the 'basic tests' and 'behind Earthdata' stages can use the same codecov uploader script.
  • Loading branch information
weiji14 committed Aug 23, 2024
1 parent 97ba3de commit 29a7230
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ install:
- source activate icepyx-env
- pip install -r requirements.txt -r requirements-dev.txt
- pip install -e .[complete]
# Setup codecov
# includes an integrity check of the uploader as recommended by CodeCov
- curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
- curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
- gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
- shasum -a 256 -c codecov.SHA256SUM
- chmod +x codecov

stages:
- name: basic tests
Expand All @@ -28,17 +37,11 @@ jobs:
include:
- stage: basic tests
script: pytest icepyx/ --verbose --cov app --ignore=icepyx/tests/test_behind_NSIDC_API_login.py --ignore=icepyx/tests/test_auth.py
# includes an integrity check of the uploader as recommended by CodeCov
after_success:
- curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
- curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
- gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
- shasum -a 256 -c codecov.SHA256SUM
- chmod +x codecov
- ./codecov -t ${CODECOV_TOKEN}
- stage: behind Earthdata
script:
- export EARTHDATA_PASSWORD=$NSIDC_LOGIN
- pytest icepyx/tests/test_behind_NSIDC_API_login.py icepyx/tests/test_auth.py
after_success:
- ./codecov -t ${CODECOV_TOKEN}

0 comments on commit 29a7230

Please sign in to comment.