Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add support for Coverage reports through codecov.io #3618

Merged
merged 3 commits into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ jobs:
run:
.github/workflows/tests.sh

- name: Upload coverage report
if: matrix.python-version == 3.5
uses: codecov/codecov-action@v1.0.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: aiida-pytests-py3.5-${{ matrix.backend }}
flags: ${{ matrix.backend }}
file: ./coverage.xml
fail_ci_if_error: false

verdi:

runs-on: ubuntu-latest
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +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

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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AiiDA (www.aiida.net) is a workflow manager for computational science with a str
|-----|----------------------------------------------------------------------------|
|Latest release| [![PyPI version](https://badge.fury.io/py/aiida-core.svg)](https://badge.fury.io/py/aiida-core) [![conda-forge](https://img.shields.io/conda/vn/conda-forge/aiida-core.svg?style=flat)](https://anaconda.org/conda-forge/aiida-core) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-core.svg)](https://pypi.python.org/pypi/aiida-core/) |
|Getting help| [![Docs status](https://readthedocs.org/projects/aiida-core/badge)](http://aiida-core.readthedocs.io/) [![Google Group](https://img.shields.io/badge/-Google%20Group-lightgrey.svg)](https://groups.google.com/forum/#!forum/aiidausers)
|Build status| [![Build Status](https://travis-ci.org/aiidateam/aiida-core.svg?branch=develop)](https://travis-ci.org/aiidateam/aiida-core) [![Coverage Status](https://coveralls.io/repos/github/aiidateam/aiida-core/badge.svg?branch=develop)](https://coveralls.io/github/aiidateam/aiida-core?branch=develop) |
|Build status| [![Build Status](https://travis-ci.org/aiidateam/aiida-core.svg?branch=develop)](https://travis-ci.org/aiidateam/aiida-core) [![Coverage Status](https://codecov.io/gh/aiidateam/aiida-core/branch/develop/graph/badge.svg)](https://codecov.io/gh/aiidateam/aiida-core) |
|Activity| [![PyPI-downloads](https://img.shields.io/pypi/dm/aiida-core.svg?style=flat)](https://pypistats.org/packages/aiida-core) [![Commit Activity](https://img.shields.io/github/commit-activity/m/aiidateam/aiida-core.svg)](https://github.com/aiidateam/aiida-core/pulse)
|Community| [![Affiliated with NumFOCUS](https://img.shields.io/badge/NumFOCUS-affiliated%20project-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org/sponsored-projects/affiliated-projects) [![Twitter](https://img.shields.io/twitter/follow/aiidateam.svg?style=social&label=Follow)](https://twitter.com/aiidateam)

Expand Down
2 changes: 2 additions & 0 deletions docs/requirements_for_rtd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ click-completion~=0.5.1
click-config-file~=0.5.0
click-spinner~=0.1.8
click~=7.0
coverage<5.0
django~=2.2
docutils==0.15.2
ete3~=3.1
Expand All @@ -31,6 +32,7 @@ pygments~=2.5
pymatgen>=2019.7.2
pymysql~=0.9.3
pyparsing~=2.4
pytest-cov~=2.7
pytest-timeout~=1.3
pytest~=5.3
python-dateutil~=2.8
Expand Down
2 changes: 2 additions & 0 deletions setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
"pgtest~=1.3,>=1.3.1",
"pytest~=5.3",
"pytest-timeout~=1.3",
"pytest-cov~=2.7",
"coverage<5.0",
"sqlalchemy-diff~=0.1.3"
],
"dev_precommit": [
Expand Down