Commit 1df29e5b authored by Daniel Scheffler's avatar Daniel Scheffler Committed by Daniel Scheffler
Browse files

Added nosetests. Activated test test artifacts for failed pipelines. Added...

Added nosetests. Activated test test artifacts for failed pipelines. Added test_py_tools_ds_install.
parent 74910860
Pipeline #1109 failed with stages
in 12 minutes and 10 seconds
......@@ -21,12 +21,32 @@ test_py_tools_ds:
- source /root/anaconda3/bin/activate
- export GDAL_DATA=/root/anaconda3/share/gdal
- export PYTHONPATH=$PYTHONPATH:/root # /root <- directory needed later
- make coverage
- make nosetests
- make docs
artifacts:
paths:
- htmlcov/
- docs/_build/html/
- nosetests.html
- nosetests.xml
when: always
test_py_tools_ds_install:
stage: test
script:
- source /root/anaconda3/bin/activate
- export GDAL_DATA=/root/anaconda3/share/gdal
- conda create -y -q --name py_tools_ds python=3.5
- source activate py_tools_ds
# resolve some requirements with conda
- conda install --yes -q -c conda-forge numpy gdal scikit-image pyproj rasterio shapely
- python setup.py install
- cd ..
- pwd
- ls
- python -c "import py_tools_ds; print(py_tools_ds)"
- python -c "from py_tools_ds.geo.vector.geometry import boxObj"
pages:
......@@ -36,6 +56,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
......@@ -43,27 +43,37 @@ clean-pyc: ## remove Python file artifacts
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
## don't include 'coverage erase' lib here because clean-test is also executed during package setup and coverage is
## only a test requirement
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr nosetests.html
rm -fr nosetests.xml
lint: ## check style with flake8
flake8 py_tools_ds 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 run --source py_tools_ds setup.py test
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
coverage erase
coverage run --source py_tools_ds setup.py test
coverage combine # must be called in order to make coverage work in multiprocessing
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=arosics --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/py_tools_ds.rst
......
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