Skip to content

Commit

Permalink
Remove omissions from coveragerc and reorder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ltalirz authored and CasperWA committed Mar 3, 2020
1 parent 03baa98 commit 8156bb1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[run]
source = aiida
omit = aiida/test*.py,aiida/*/test*.py,aiida/*/*/test*.py,aiida/*/*/*/test*.py,aiida/*/*/*/*/test*.py,aiida/*/*/*/*/*/test*.py,aiida/*/migrations/*.py,aiida/*/migrations/versions/*.py

[html]
directory = .ci/coverage/html
28 changes: 15 additions & 13 deletions .github/workflows/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@ set -ev

# Make sure the folder containing the workchains is in the python path before the daemon is started
export PYTHONPATH="${PYTHONPATH}:${GITHUB_WORKSPACE}/.ci"
# show timings of tests
export PYTEST_ADDOPTS=" --durations=0"

# pytest options:
# - report timings of tests
# - pytest-cov configuration taken from top-level .coveragerc
# - coverage is reported as XML and in terminal,
# including the numbers/ranges of lines which are not covered
# - coverage results of multiple tests are collected
# - coverage is reported on files in aiida/
export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --durations=0 --cov-config=.coveragerc --cov-report xml --cov-report term-missing --cov-append --cov=aiida"

# daemon tests
verdi daemon start 4
verdi -p test_${AIIDA_TEST_BACKEND} run .ci/test_daemon.py
verdi daemon stop

# Make sure
# - omissions are taken from the top-level .coveragerc
# - coverage is reported as XML and in terminal including
# the numbers/ranges of lines which are not covered,
# - coverage results of multiple tests are collected,
# - the base directory for files to consider is aiida/
export PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov-config=.coveragerc --cov-report xml --cov-report term-missing --cov-append --cov=aiida"

AIIDA_TEST_PROFILE=test_$AIIDA_TEST_BACKEND pytest tests
AIIDA_TEST_PROFILE=test_$AIIDA_TEST_BACKEND pytest .ci/pytest
# tests for the testing infrastructure
pytest --noconftest .ci/test_test_manager.py
pytest --noconftest .ci/test_profile_manager.py
python .ci/test_plugin_testcase.py # uses custom unittest test runner
AIIDA_TEST_PROFILE=test_$AIIDA_TEST_BACKEND pytest .ci/pytest

python .ci/test_plugin_testcase.py
# main aiida-core tests
AIIDA_TEST_PROFILE=test_$AIIDA_TEST_BACKEND pytest tests

0 comments on commit 8156bb1

Please sign in to comment.