diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000000000000000000000000000000000000..9ef16d0a136fb56b0d459c967584dc0b77fb1335 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,12 @@ +# .coveragerc to control coverage.py +[run] +branch = True +omit = + # Omit all test_ functions + **/test_* + # Omit blender functions / can be only tested with blender files + **/blend* +source = navipy + +[html] +directory = coverage_html_report \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bbc3a1d12b453b340d56459cdad88f620651db85..966267a078906585e09e5f4909a3d83d327f7ea2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ image: python:latest stages: - build - test + - coverage - doc_build - deploy @@ -26,8 +27,11 @@ navipy_install: flake8: stage: test + dependencies: + - navipy_install + script: - - pip3 install tox flake8 + - source $CI_PROJECT_DIR/venv/bin/activate - python3 -m flake8 navipy/*.py navipy_unittest: @@ -37,22 +41,33 @@ navipy_unittest: script: - source $CI_PROJECT_DIR/venv/bin/activate + - python3 -m coverage run -m unittest discover navipy + + artifacts: + paths: + - .coverage coverage: - stage: test + stage: coverage + dependencies: + - navipy_install + - navipy_unittest + script: - - pip3 install --user nose - - pip3 install --user coverage - - python3 -m nose -c .noserc -q --cover-html-dir=build --cover-html - - python3 -m coverage report -m - coverage: '/TOTAL.+ ([0-9]{1,3}%)/' + - source $CI_PROJECT_DIR/venv/bin/activate + - python3 -m coverage html + artifacts: paths: - - build + - coverage_html_report expire_in: 1 day doc_build: stage: doc_build + dependencies: + - navipy_install + - coverage + script: - source $CI_PROJECT_DIR/venv/bin/activate - pip3 install --user sphinx sphinx_rtd_theme @@ -60,7 +75,7 @@ doc_build: artifacts: paths: - - build + - doc/build pages: @@ -76,11 +91,12 @@ pages: script: - ssh -p50022 bolirev@bioneuro77.biologie.uni-bielefeld.de "mkdir -p /fastdata/html/navipy/" - mkdir -p public/coverage - - cp -fr docs/build/html/* public/ - - cp -fr build/* public/coverage/ + - cp -fr doc/build/html/* public/ + - cp -fr coverage_html_report/* public/coverage/ dependencies: - coverage + - doc_build artifacts: paths: diff --git a/setup.py b/setup.py index d445eafb86a023c37d2e043b3f6af03c130f1e48..aa1cce693e1e5642fa6265e39f7ccb0b48036722 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,8 @@ setup_dict = {'name': 'navipy', 'sphinx-argparse', 'ipython', 'flake8', - 'tox'], + 'tox', + 'coverage'], 'package_data': {'navipy': ['resources/database.db', 'resources/*.blend']}, 'include_package_data': True,