Skip to content
Snippets Groups Projects
Commit 4bbd0f13 authored by Olivier Bertrand's avatar Olivier Bertrand
Browse files

Add coverage function

parent 65d0f572
Branches
Tags
No related merge requests found
# .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
......@@ -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:
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment