Skip to content
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

Exit code returned to console does not reflect failure status when running multiple environments #2945

Open
szabi opened this issue Mar 14, 2023 · 1 comment
Labels
help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@szabi
Copy link

szabi commented Mar 14, 2023

Issue

When running a single environment, tox correctly reports the exit code back to the calling shell cmd.exe:

> tox run -e py310-fail 1>NUL 2>NUL & if ERRORLEVEL 1 echo FAIL
FAIL
>
> tox run -e py310-ok 1>NUL 2>NUL & if ERRORLEVEL 1 echo FAIL
>

However, when multiple environments are run, independent of individual results, the error code always indicates "OK"

> tox run -e py310-ok,py310-fail 1>NUL 2>NUL & if ERRORLEVEL 1 echo FAIL
>
> tox run -e py310-fail,py310-fail2 1>NUL 2>NUL & if ERRORLEVEL 1 echo FAIL
>

Expected behaviour:

If at least one run fails, that should be reflected in the return code:

> tox run -e py310-ok,py310-fail 1>NUL 2>NUL & if ERRORLEVEL 1 echo FAIL
FAIL
>
> tox run -e py310-fail,py310-fail2 1>NUL 2>NUL & if ERRORLEVEL 1 echo FAIL
FAIL
>

Of course, if all succeed, that should also be correctly transported:

> tox run -e py310-ok,py310-ok2 1>NUL 2>NUL & if ERRORLEVEL 1 echo FAIL
>

Environment

  • OS: Windows 10
  • pip list of the host Python where tox is installed:
Package    Version
---------- -------
pip        23.0.1
setuptools 67.3.3
wheel      0.38.4

(tox is installed via pipx and is not in that environment).

>tox --version
4.4.6 from <USERHOME>\.local\pipx\venvs\tox\lib\site-packages\tox\__init__.py

Minimal example

I made the effort to set up a minimal example. Feel free to peruse it:
See this gist

@gaborbernat
Copy link
Member

PR welcome to fix this 😊

@gaborbernat gaborbernat added the help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

No branches or pull requests

2 participants