Skip to content
Snippets Groups Projects
Commit 25e302f7 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Several changes to the CI/testing

1) Rename all tests to the pytest standard naming convention
2) Update to use pytest to run the tests and collect coverage
3) Simplify gitlab CI script using above changes
parent 325e0499
No related branches found
No related tags found
1 merge request!191Update test suite
Pipeline #30821 passed
[run]
omit =
test/example_test.py
test/gw_example_test.py
test/noise_realisation_test.py
test/other_test.py
...@@ -21,11 +21,11 @@ python-2: ...@@ -21,11 +21,11 @@ python-2:
- apt install -y libgl1-mesa-glx - apt install -y libgl1-mesa-glx
- pip install -r requirements.txt - pip install -r requirements.txt
- pip install -r optional_requirements.txt - pip install -r optional_requirements.txt
- pip install lalsuite enum gwpy - pip install enum
script: script:
- python setup.py install - python setup.py install
# Run tests without finding coverage # Run tests without finding coverage
- for test in test/*tests.py; do python $test; done - pytest
# test example on python 3 # test example on python 3
python-3: python-3:
...@@ -39,6 +39,7 @@ python-3: ...@@ -39,6 +39,7 @@ python-3:
- pip install 'coverage>=4.5' - pip install 'coverage>=4.5'
- pip install coverage-badge - pip install coverage-badge
- pip install flake8 - pip install flake8
- pip install pytest-cov
script: script:
- python setup.py install - python setup.py install
...@@ -46,23 +47,9 @@ python-3: ...@@ -46,23 +47,9 @@ python-3:
- flake8 . - flake8 .
# Run tests and collect coverage data # Run tests and collect coverage data
- coverage --version - pytest --cov=tupak
- coverage erase
- coverage run --debug=trace --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/conversion_tests.py
- coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/calibration_tests.py
- coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/detector_tests.py
- coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/gw_likelihood_tests.py
- coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/likelihood_tests.py
- coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/prior_tests.py
- coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/sampler_tests.py
- coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/utils_tests.py
- coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/waveform_generator_tests.py
- coverage html - coverage html
- coverage-badge -o coverage_badge.svg -f - coverage-badge -o coverage_badge.svg -f
# Run all other tests (no coverage data collected)
- python test/example_tests.py
- python test/gw_example_tests.py
- python test/noise_realisation_tests.py
# Make the documentation # Make the documentation
- pip install -r docs/requirements.txt - pip install -r docs/requirements.txt
......
...@@ -2,3 +2,7 @@ ...@@ -2,3 +2,7 @@
exclude = .git,docs,build,dist,test,examples,*__init__.py exclude = .git,docs,build,dist,test,examples,*__init__.py
max-line-length = 160 max-line-length = 160
ignore = E129 ignore = E129
[tool:pytest]
addopts =
--ignore test/other_test.py
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment