CI: improve "test"section
Today the test section is repeating several command.
The only difference is options provided to pytest
. It could be defined through a variable (probably).
# test
test_python3.8:
image: docker-registry.esrf.fr/dau/ewoks:python_3.8_glx
extends: .build_template
script:
- python -m pip install pytest
- python -m pip install silx tomoscan nxtomo --pre
- python -m pip install -e .[test]
- python -m pip install pytest-cov
- python -m pytest --cov-config=.coveragerc --cov=nxtomomill nxtomomill/
variables:
TOMOTOOLS_SWMR: "False"
test_python3.11:
image: docker-registry.esrf.fr/dau/ewoks:python_3.11_glx
extends: .build_template
script:
- python -m pip install pytest
- python -m pip install silx tomoscan nxtomo --pre
- python -m pip install -e .[test]
- python -m pip install pytest-cov
- python -m pytest --cov-config=.coveragerc --cov=nxtomomill nxtomomill/ --capture=no --verbose
variables:
TOMOTOOLS_SWMR: "True"
test_python3.10:
image: docker-registry.esrf.fr/dau/ewoks:python_3.10_glx
extends: .build_template
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
script:
- python -m pip install pytest
- python -m pip install silx tomoscan nxtomo --pre
- python -m pip install -e .[test]
- python -m pip install pytest-cov
- python -m pytest --cov-config=.coveragerc --cov-report term-missing --cov-report html:code_coverage_infos --cov=nxtomomill nxtomomill/
- mv code_coverage_infos artifacts/code_coverage
artifacts:
paths:
- artifacts/code_coverage/
when: on_success
expire_in: 6h