-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCSB-40 add JWST and RomanCal coverage tests (#55)
* add JWST and RomanCal coverage tests * cache tox envs * reorder `tox.ini` * explicit python * attach python versions to tox envs * minor fix * dependencies in root env * dependencies in child envs * install from extras * add python 3.7 * restore matrices * `astropy` only supports Python >=3.8 * rearrange arguments * add `CRDS_*` variables to tox envs * pass environment variables * reorder ini file * restore coverage report * test direct checkout of relevant pipelines * call `cd` with `bash` * revert previous change * use JWST CRDS server when running `romancal` tests * add `pip freeze` before test command for debugging purposes * update `CRDS_PATH` in workflow * try with public CRDS * pin local install to `0.3.1` * pin local install to `0.3.1` * add duplicate workflow cancel from JWST pipeline * explicitly set version `0.3.1` for `romancal` tests * revert using PUB CRDS (was just for testing) * add to changelog
- Loading branch information
1 parent
04f7d47
commit a781c95
Showing
4 changed files
with
205 additions
and
86 deletions.
There are no files selected for viewing
This file contains 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,19 @@ | ||
name: Cancel duplicate workflows | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- requested | ||
|
||
# Note: This has to be in workflow_run so it works for PRs from forks. And only cancel | ||
# pull_request triggers, not push, i.e. merges into master. | ||
jobs: | ||
cancel: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.event == 'pull_request' }} | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # 0.8.0 | ||
with: | ||
workflow_id: ${{ github.event.workflow.id }} |
This file contains 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
This file contains 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
This file contains 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,48 +1,94 @@ | ||
[tox] | ||
envlist= py38,style,bandit | ||
|
||
[testenv] | ||
extras= test | ||
[testtenv] | ||
extras = test | ||
# astropy will complain if the home directory is missing | ||
passenv= HOME | ||
commands= | ||
pytest | ||
|
||
[testenv:egg_info] | ||
deps= | ||
commands= | ||
python setup.py egg_info | ||
|
||
[testenv:twine] | ||
deps= | ||
twine | ||
commands= | ||
twine check {distdir}/* | ||
passenv = | ||
HOME | ||
deps = | ||
pytest-xdist | ||
commands = | ||
pip freeze | ||
pytest -n auto | ||
|
||
[testenv:style] | ||
deps= | ||
deps = | ||
flake8 | ||
commands= | ||
commands = | ||
flake8 --count src | ||
|
||
[testenv:coverage] | ||
deps= | ||
codecov | ||
coverage | ||
commands= | ||
coverage run --source=stpipe -m pytest | ||
coverage report -m | ||
codecov -e TOXENV | ||
passenv= TOXENV CI TRAVIS TRAVIS_* CODECOV_* DISPLAY HOME | ||
|
||
[testenv:bandit] | ||
deps= | ||
deps = | ||
bandit | ||
commands= | ||
commands = | ||
bandit -r -ll src | ||
|
||
[testenv:build-docs] | ||
basepython= python3.8 | ||
extras= docs | ||
commands= | ||
basepython = python3.8 | ||
extras = docs | ||
commands = | ||
sphinx-build -W docs/source build/docs | ||
|
||
[testenv:coverage] | ||
basepython = python3.9 | ||
extras = test | ||
deps = | ||
codecov | ||
pytest-cov | ||
pytest-xdist | ||
passenv = | ||
CI | ||
CODECOV_* | ||
CRDS_* | ||
DISPLAY | ||
HOME | ||
TOXENV | ||
TRAVIS | ||
TRAVIS_* | ||
commands = | ||
pip freeze | ||
pytest -n auto --cov-report=xml --cov={toxinidir}/src/stpipe | ||
coverage report -m | ||
|
||
[testenv:jwst-cov] | ||
basepython = python3.9 | ||
extras = test | ||
deps = | ||
codecov | ||
jwst[test] @ git+https://github.com/spacetelescope/jwst.git | ||
pytest-cov | ||
pytest-xdist | ||
passenv = | ||
CI | ||
CODECOV_* | ||
CRDS_* | ||
DISPLAY | ||
HOME | ||
TOXENV | ||
TRAVIS | ||
TRAVIS_* | ||
commands = | ||
pip freeze | ||
pytest -n auto --cov-report=xml --cov={toxinidir}/src/stpipe --ignore-glob=timeconversion --ignore-glob=associations --pyargs {posargs:jwst} | ||
coverage report -m | ||
|
||
[testenv:romancal-cov] | ||
basepython = python3.9 | ||
extras = test | ||
deps = | ||
codecov | ||
pytest-cov | ||
pytest-xdist | ||
romancal[test] @ git+https://github.com/spacetelescope/romancal.git | ||
passenv = | ||
CI | ||
CODECOV_* | ||
CRDS_* | ||
DISPLAY | ||
HOME | ||
TOXENV | ||
TRAVIS | ||
TRAVIS_* | ||
commands = | ||
pip install -U stpipe==0.3.1 | ||
pip freeze | ||
pytest -n auto --cov-report=xml --cov={toxinidir}/src/stpipe --pyargs {posargs:romancal} | ||
coverage report -m |