Skip to content

Commit

Permalink
Add Codecov to gensim repo (#3252)
Browse files Browse the repository at this point in the history
* add codecov

* add pytest-cov into multibuild

* upload coverage report form py38 (linux)
  • Loading branch information
menshikh-iv committed Oct 24, 2021
1 parent 9ca0fe1 commit d2341aa
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
PLAT: x86_64
UNICODE_WIDTH: 32
MB_PYTHON_VERSION: ${{ matrix.python-version }} # MB_PYTHON_VERSION is needed by Multibuild
TEST_DEPENDS: Morfessor==2.0.2a4 python-levenshtein==0.12.0 visdom==0.1.8.9 pytest mock cython nmslib pyemd testfixtures scikit-learn pyemd
TEST_DEPENDS: Morfessor==2.0.2a4 python-levenshtein==0.12.0 visdom==0.1.8.9 pytest pytest-cov mock cython nmslib pyemd testfixtures scikit-learn pyemd
DOCKER_TEST_IMAGE: multibuild/xenial_x86_64
TRAVIS_OS_NAME: ${{ matrix.travis-os-name }}
SKIP_NETWORK_TESTS: 1
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,18 @@ jobs:
run: ulimit -c unlimited -S # enable core dumps
- name: Run tox tests
run: tox -e ${{ matrix.tox }}
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-20.04' && matrix.python == '3.8'
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: ./coverage.xml
verbose: true


- name: Collect corefile
if: ${{ failure() }}
run: |
pwd
COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1)
if [[ -f "$COREFILE" ]]; then EXECFILE=$(gdb -c "$COREFILE" -batch | grep "Core was generated" | tr -d "\`" | cut -d' ' -f5); file "$COREFILE"; gdb -c "$COREFILE" "$EXECFILE" -x continuous_integration/debug.gdb -batch; fi
if [[ -f "$COREFILE" ]]; then EXECFILE=$(gdb -c "$COREFILE" -batch | grep "Core was generated" | tr -d "\`" | cut -d' ' -f5); file "$COREFILE"; gdb -c "$COREFILE" "$EXECFILE" -x continuous_integration/debug.gdb -batch; fi
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def run(self):
# packages included for build-testing everywhere
core_testenv = [
'pytest',
'pytest-cov',
# 'pytest-rerunfailures', # disabled 2020-08-28 for <https://github.com/pytest-dev/pytest-rerunfailures/issues/128>
'mock',
'cython',
Expand Down
20 changes: 19 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,26 @@ ignore = E203, # space before :
exclude = .venv, .git, .tox, dist, doc, build, gensim/models/deprecated


[coverage:run]
source=gensim

[coverage:report]
omit =
gensim/test/*
*/__init__.py

exclude_lines =
pragma: no cover
def __repr__
def __str__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:

ignore_errors = True

[pytest]
addopts = -rfxEXs --durations=20 --showlocals
addopts = -rfxEXs --durations=20 --showlocals --cov=gensim/ --cov-report=xml


[testenv]
Expand Down

0 comments on commit d2341aa

Please sign in to comment.