Skip to content

Commit

Permalink
Merge pull request #59 from pganssle/fix_coverage
Browse files Browse the repository at this point in the history
Fix coverage
  • Loading branch information
pganssle committed Mar 1, 2020
2 parents db12cdf + 297f635 commit 35587d5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
14 changes: 7 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ strategy:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
macOS:
python.version: '3.6'
python.version: '3.7'
POOL_IMAGE: macos-10.13
Windows:
python.version: '3.6'
python.version: '3.7'
POOL_IMAGE: vs2017-win2016
installzic: 'windows'
Black:
python.version: '3.7'
TOXENV: black-check
Docs:
python.version: '3.6'
python.version: '3.7'
TOXENV: docs
Build:
python.version: '3.6'
python.version: '3.7'
TOXENV: build

variables:
Expand All @@ -38,12 +40,10 @@ steps:
displayName: Ensure prereqs

- bash: |
$PYTHON -m tox
if [[ $TOXENV == "py" ]];
then
$PYTHON -m tox -- --junitxml=unittests/TEST-$(AGENT.JobName).xml
$PYTHON -m tox -e coverage,codecov
else
$PYTHON -m tox
fi
displayName: Run tox

Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@ requires = [
"setuptools>40.6.0",
"wheel",
]

build-backend = "setuptools.build_meta"

[tool.coverage.run]
source = ["grid_strategy"]

[tool.coverage.paths]
source = ["src", ".tox/*/site-packages"]

[tool.coverage.report]
show_missing = true
skip_covered = true

[tool.black]
line-length = 88
py36 = true
Expand Down
18 changes: 7 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36, py37, black-check
envlist = py36, py37, py38, black-check
skip_missing_interpreters = true
isolated_build = true

Expand All @@ -9,21 +9,21 @@ passenv = TOXENV CI CODECOV_* SYSTEM_* AGENT_* BUILD_* TF_BUILD
deps =
pytest
pytest-cov >= 2.0.0
coverage
commands = pytest --cov-config="{toxinidir}/tox.ini" \
--cov="{envsitepackagesdir}/grid_strategy" \
--cov="{toxinidir}/tests" \
coverage[toml] >=5.0.2
commands = pytest {toxinidir} \
--cov="grid_strategy" \
--cov="tests" \
{posargs}

[testenv:coverage]
description = combine coverage data and create reports
deps = coverage
deps = coverage[toml] >= 5.0.2
skip_install = True
changedir = {toxworkdir}
setenv = COVERAGE_FILE=.coverage
commands = coverage erase
coverage combine
coverage report --rcfile={toxinidir}/tox.ini
coverage report
coverage xml

[testenv:codecov]
Expand All @@ -32,10 +32,6 @@ deps = codecov
skip_install = True
commands = codecov --file {toxworkdir}/coverage.xml

[coverage:report]
skip_covered = True
show_missing = True

[testenv:black-check]
description = test if black works
deps =
Expand Down

0 comments on commit 35587d5

Please sign in to comment.