Skip to content

Commit

Permalink
Fix tests for Fedora 31+ and coverage
Browse files Browse the repository at this point in the history
Since Fedora 31, some macros that we used in RDO packages need to
be fixed. Fixing this also exposed an issue when running coverage
tests in parallel [1], so we need to update the way we are running
tests to cope up.

[1] - nedbat/coveragepy#883

Change-Id: I5c106b31106d98efc0c115510aaf962e79cc0c69
  • Loading branch information
javierpena authored and Zuul CI committed Mar 18, 2020
1 parent 7a5dbeb commit 66e5bc2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
3 changes: 3 additions & 0 deletions setup.cfg
Expand Up @@ -41,3 +41,6 @@ exclude=build,lib,.tox,third,*.egg,docs,packages,.eggs
# W605 skipped due to false positives
ignore = E123,E125,H803,W503,W605
show-source = True

[coverage:run]
parallel=true
6 changes: 3 additions & 3 deletions tests/assets/spec/reqcheck-excess/foo.spec
Expand Up @@ -6,9 +6,9 @@
%endif

%global pyver_bin python%{pyver}
%global pyver_sitelib %python%{pyver}_sitelib
%global pyver_install %py%{pyver}_install
%global pyver_build %py%{pyver}_build
%global pyver_sitelib %{expand:%{python%{pyver}_sitelib}}
%global pyver_install %{expand:%{py%{pyver}_install}}
%global pyver_build %{expand:%{py%{pyver}_build}}
# End of macros for py2/py3 compatibility

Name: foo
Expand Down
16 changes: 10 additions & 6 deletions tox.ini
Expand Up @@ -31,29 +31,29 @@ deps =
pytest-cov
coverage
commands =
py.test --cov-append --cov rdopkg {posargs}
py.test --cov rdopkg {posargs}

[testenv:py3-unit]
deps =
pytest
pytest-cov
coverage
commands =
py.test --cov-append --cov rdopkg {posargs}
py.test --cov rdopkg {posargs}

[testenv:py2-feature]
deps =
behave
coverage
commands =
coverage run -a --source='rdopkg' -m behave --format=progress
coverage run --source='rdopkg' -m behave --format=progress

[testenv:py3-feature]
deps =
behave
coverage
commands =
coverage run -a --source='rdopkg' -m behave --format=progress
coverage run --source='rdopkg' -m behave --format=progress

[testenv:py2-integration]
commands = {toxinidir}/tests/integration/test_integration.sh
Expand All @@ -63,11 +63,15 @@ commands = {toxinidir}/tests/integration/test_integration.sh

[testenv:py2-cover]
deps = coverage
commands = coverage html
commands =
coverage combine
coverage html

[testenv:py3-cover]
deps = coverage
commands = coverage html
commands =
coverage combine
coverage html

[testenv:lint]
deps = pycodestyle
Expand Down

0 comments on commit 66e5bc2

Please sign in to comment.