Closed pharmpy-dev-123 closed 1 year ago
Hello, thanks for asking a question. I guess your tox.ini
is something like the following and running tox
with tox-gh-actions runs both unit
and unit-cover
.
[tox]
envlist = unit, unit-cover, <maybe other envs?>
[gh-actions]
python =
3.10: unit
[testenv]
I cannot come up with a clean solution but I can propose a few workarounds.
Option 1: If your tox.ini
is simple and doesn't have many other envs, you can specify the list of environments you want to execute explicitly like tox -e unit
. This will disable tox-gh-actions' environment overrides but you can still enjoy other features of tox-gh-actions such as log line grouping. https://github.com/ymyzk/tox-gh-actions/tree/v2.10.0#overriding-environments-to-run
Option 2: Renaming the name of the tox environment can be another option. For example, you can rename unit
to something like unit-only
so that tox-gh-actions won't be confused.
I have configured
tox
so that I can runtox -e unit
for unit tests andtox -e unit-cover
for unit tests with coverage. It is impossible for me to usetox-gh-actions
to run onlytox -e unit
if bothunit
andunit-cover
are listed inenvlist
(because there are some GHA workflows in which I need coverage, and others in which I do not need it). If I try to filter by factors,tox-gh-actions
selects both environments and runs them sequentially. Is there a solution other than not usingtox-gh-actions
?