Skip to content

Coverage reporting #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
[run]
branch = True
source = cwltool

[report]
exclude_lines =
if self.debug:
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
ignore_errors = True
omit =
tests/*
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,16 @@ typeshed/2and3/ruamel/yaml

#mypy
.mypy_cache/

# Files generated by Makefile
.cache/
cache/
.coverage
coverage.xml
htmlcov
output
output.txt
pydocstyle_report.txt
response.txt
test.txt
value
21 changes: 8 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,18 @@ pylint_report.txt: ${PYSOURCES}
diff_pylint_report: pylint_report.txt
diff-quality --violations=pylint pylint_report.txt

.coverage: $(PYSOURCES) all
export COVERAGE_PROCESS_START=${mkfile_dir}.coveragerc; \
cd ${CWL}; ./run_test.sh RUNNER=cwltool
coverage run setup.py test
coverage combine ${CWL} ${CWL}/draft-3/ ./
.coverage: tests

coverage: .coverage
coverage report

coverage.xml: .coverage
python-coverage xml
coverage xml

coverage.html: htmlcov/index.html

htmlcov/index.html: .coverage
python-coverage html
@echo Test coverage of the Python code is now in htmlcov/index.html

coverage-report: .coverage
python-coverage report
coverage html

diff-cover: coverage-gcovr.xml coverage.xml
diff-cover coverage-gcovr.xml coverage.xml
Expand All @@ -139,8 +134,8 @@ diff-cover.html: coverage-gcovr.xml coverage.xml
--html-report diff-cover.html

## test : run the ${MODULE} test suite
test: FORCE
./setup.py test
test: $(PYSOURCES)
python setup.py test --addopts "--cov cwltool"

sloccount.sc: ${PYSOURCES} Makefile
sloccount --duplicates --wide --details $^ > sloccount.sc
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install:
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""

build_script:
- "%CMD_IN_ENV% pip install -U setuptools"
- "%CMD_IN_ENV% python -m pip install -U setuptools"
- "%CMD_IN_ENV% pip install ."


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
tagger = egg_info_cmd.egg_info

needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
pytest_runner = ['pytest-runner', 'pytest-cov'] if needs_pytest else []

setup(name='cwltool',
version='1.0',
Expand Down
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ skip_missing_interpreters = True
3.6 = py36

[testenv]
passenv = CI TRAVIS TRAVIS_*
deps =
-rrequirements.txt
py{27,34,35,36}-unit: codecov
py{27,34,35,36}-lint: flake8

commands =
py{27,34,35,36}-unit: python setup.py test
py{27,34,35,36}-unit: python setup.py test --addopts "--cov-report xml --cov cwltool"
py{27,34,35,36}-unit: codecov
py{27,34,35,36}-lint: flake8 schema_salad setup.py

whitelist_externals =
Expand Down