Commit 4dbde980 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Merge branch 'coverage_report' into 'master'

Extend the files Makefile and .gitlab-ci.yml for a more detailed coverage report.

See merge request !1

Enables nosetests including HTML output.
parents 48a1f580 c807fa7c
Pipeline #884 passed with stages
in 1 minute and 3 seconds
......@@ -21,13 +21,15 @@ test_geoarray:
- source /root/anaconda3/bin/activate
- export GDAL_DATA=/root/anaconda3/share/gdal
- export PYTHONPATH=$PYTHONPATH:/root # /root <- directory needed later
- make coverage
- pip install rednose
- make nosetests
- make docs
artifacts:
paths:
- htmlcov/
- docs/_build/html/
- nosetests.html
- nosetests.xml
pages:
stage: deploy_pages
......@@ -36,6 +38,8 @@ pages:
script:
- mkdir -p public/coverage
- cp -r htmlcov/* public/coverage/
- mkdir -p public/nosetests_reports
- cp nosetests.* public/nosetests_reports/
- mkdir -p public/doc
- cp -r docs/_build/html/* public/doc/
......
.PHONY: clean clean-test clean-pyc clean-build docs help
.PHONY: clean clean-test clean-pyc clean-build docs help nosetests
.DEFAULT_GOAL := help
define BROWSER_PYSCRIPT
import os, webbrowser, sys
......@@ -28,7 +28,6 @@ help:
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
......@@ -43,27 +42,35 @@ clean-pyc: ## remove Python file artifacts
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
coverage erase
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr nosetests.html
rm -fr nosetests.xml
lint: ## check style with flake8
flake8 geoarray tests
test: ## run tests quickly with the default Python
python setup.py test
python setup.py test
test-all: ## run tests on every Python version with tox
tox
coverage: ## check code coverage quickly with the default Python
coverage: clean-test ## check code coverage quickly with the default Python
coverage run --source geoarray setup.py test
coverage run --source geoarray setup.py test
coverage report -m
coverage html
# $(BROWSER) htmlcov/index.html
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
nosetests: clean-test ## Runs nosetests with coverage, xUnit and nose-html-output
## - puts the coverage results in the folder 'htmlcov'
## - generates 'nosetests.html' (--with-html)
## - generates 'nosetests.xml' (--with-xunit) which is currently not visualizable by GitLab
nosetests -vv --with-coverage --cover-package=geoarray --cover-erase --cover-html --cover-html-dir=htmlcov \
--with-html --with-xunit --rednose --force-color
docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/geoarray.rst
......@@ -73,7 +80,7 @@ docs: ## generate Sphinx HTML documentation, including API docs
$(MAKE) -C docs html
# $(MAKE) -C docs latex
# $(MAKE) -C docs latexpdf
$(BROWSER) docs/_build/html/index.html
# $(BROWSER) docs/_build/html/index.html
servedocs: docs ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment