Skip to content

infra: use pytest-cov instead of coverage #1747

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 27, 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
4 changes: 2 additions & 2 deletions buildspec-unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ phases:
- TOX_PARALLEL_NO_SPINNER=1
- PY_COLORS=0
- start_time=`date +%s`
- tox -e flake8,pylint,twine,black-check
- tox -e flake8,pylint,twine,black-check --parallel all
- ./ci-scripts/displaytime.sh 'flake8,pylint,twine,black-check' $start_time

- start_time=`date +%s`
- tox -e sphinx,doc8
- tox -e sphinx,doc8 --parallel all
- ./ci-scripts/displaytime.sh 'sphinx,doc8' $start_time

# run unit tests
Expand Down
9 changes: 8 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ passenv =
# {posargs} can be passed in by additional arguments specified when invoking tox.
# Can be used to specify which tests to run, e.g.: tox -- -s
commands =
coverage run --source sagemaker -m pytest {posargs}
pytest --cov=sagemaker --cov-append {posargs}
{env:IGNORE_COVERAGE:} coverage report --fail-under=86 --omit */tensorflow/tensorflow_serving/*
deps = .[test]
depends =
{py27,py36,py37,py38}: clean

[testenv:flake8]
basepython = python3
Expand Down Expand Up @@ -130,3 +132,8 @@ basepython = python3
deps = black==19.10b0
commands =
black -l 100 --check ./

[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase