Refactor CI setup

This commit is contained in:
Markus Unterwaditzer 2017-01-30 13:37:17 +01:00
parent 185abe9ca9
commit 413e2de45d
4 changed files with 40 additions and 8 deletions

22
.coveragerc Normal file
View file

@ -0,0 +1,22 @@
[run]
branch = True
[paths]
source = vdirsyncer/
[report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about missing debug-only code:
def __repr__
if self\.debug
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

View file

@ -1,4 +1,7 @@
{
"after_script": [
"make -e after-$BUILD"
],
"branches": {
"only": [
"auto",

View file

@ -28,19 +28,19 @@ install-test: install-servers
git+https://github.com/DRMacIver/hypothesis \
git+https://github.com/pytest-dev/pytest; \
fi
[ $(CI) != "true" ] || pip install coverage codecov
[ $(CI) != "true" ] || pip install pytest-cov codecov
test:
set -e; \
if [ "$(CI)" = "true" ]; then \
coverage run --branch --concurrency=thread --source=vdirsyncer/ --module pytest; \
py.test --cov-config .coveragerc; \
else \
py.test; \
fi; \
STATUS="$$?"; \
set -e; \
[ "$(CI)" != "true" ] || codecov; \
[ "$(CI)" != "true" ] || scripts/upload-hypothesis-db.sh; \
[ "$$STATUS" = "0" ]
fi
after-test:
[ "$(CI)" != "true" ] || codecov
[ "$(CI)" != "true" ] || scripts/upload-hypothesis-db.sh
install-style: install-docs
pip install flake8 flake8-import-order flake8-bugbear
@ -52,6 +52,9 @@ style:
sphinx-build -W -b html ./docs/ ./docs/_build/html/
python3 scripts/make_travisconf.py | diff -b .travis.yml -
after-style:
true
travis-conf:
python3 scripts/make_travisconf.py > .travis.yml
@ -61,6 +64,9 @@ install-docs:
docs:
cd docs && make html
after-docs:
true
sh: # open subshell with default test config
$$SHELL;

View file

@ -27,6 +27,7 @@ make -e install-$BUILD;
"""]
cfg['script'] = ["make -e $BUILD"]
cfg['after_script'] = ["make -e after-$BUILD"]
matrix = []
cfg['matrix'] = {'include': matrix}