Skip to content

Let pytest generate both HTML and XML coverage reports #512

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 3 commits into from
Jul 11, 2020
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
5 changes: 0 additions & 5 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ jobs:
########################################################################################
- job:
displayName: 'Mac'
condition: False

pool:
vmImage: 'macOS-10.14'
Expand Down Expand Up @@ -159,7 +158,6 @@ jobs:
- bash: |
set -x -e
source activate testing
coverage xml
echo "Uploading coverage to Codecov"
codecov -e PYTHON AGENT_OS
env:
Expand All @@ -172,7 +170,6 @@ jobs:
########################################################################################
- job:
displayName: 'Windows'
condition: False

pool:
vmImage: 'vs2017-win2016'
Expand Down Expand Up @@ -249,8 +246,6 @@ jobs:
- bash: |
set -x -e
source activate testing
coverage report -m
coverage xml
codecov -e PYTHON AGENT_OS
env:
CODECOV_TOKEN: $(codecov.token)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ MANIFEST
.ipynb_checkpoints/
.vscode/
tmp-test-dir-with-unique-name/
coverage.xml
htmlcov
build/
dist/
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ script:
# Things to do if the build is successful
after_success:
# Upload coverage information
- coverage xml
- codecov -e PYTHON

deploy:
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Build, package, test, and clean
PROJECT=pygmt
TESTDIR=tmp-test-dir-with-unique-name
PYTEST_ARGS=--cov-config=../.coveragerc --cov-report=term-missing --cov=$(PROJECT) --doctest-modules -v --mpl --mpl-results-path=results --pyargs ${PYTEST_EXTRA}
PYTEST_ARGS=--cov=$(PROJECT) --cov-config=../.coveragerc \
--cov-report=term-missing --cov-report=xml --cov-report=html \
--doctest-modules -v --mpl --mpl-results-path=results \
--pyargs ${PYTEST_EXTRA}
BLACK_FILES=$(PROJECT) setup.py doc/conf.py examples
FLAKE8_FILES=$(PROJECT) setup.py
LINT_FILES=$(PROJECT) setup.py
Expand All @@ -27,7 +30,8 @@ test:
@cd $(TESTDIR); python -c "import $(PROJECT); $(PROJECT).show_versions()"
@echo ""
cd $(TESTDIR); pytest $(PYTEST_ARGS) $(PROJECT)
cp $(TESTDIR)/.coverage* . && coverage html
cp $(TESTDIR)/coverage.xml .
cp -r $(TESTDIR)/htmlcov .
rm -r $(TESTDIR)

format:
Expand All @@ -43,6 +47,6 @@ lint:
clean:
find . -name "*.pyc" -exec rm -v {} \;
find . -name "*~" -exec rm -v {} \;
rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache htmlcov
rm -rvf build dist MANIFEST *.egg-info __pycache__ .coverage .cache htmlcov coverage.xml
rm -rvf $(TESTDIR)
rm -rvf baseline