-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
fail when envlist is empty #66
Comments
Agreed, it was surprising than tox running no testenv resulted in success. |
This is especially important since it is not very well documented that, in order to be eligible for selection by this plugin, the env must also be present in |
Hello everyone, thanks for the feedback. At this point, I'd like to avoid actually failing the tox when it couldn't find no environments as it can be technically a breaking change for exiting users. At the same time, I understand this issue can be a bit difficult to catch for users. I'd like to propose showing a warning message when this problem happens as a mitigation: #123
As the first example in README only specifies [tox]
envlist = py37, py38, py39, py310, mypy
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310, mypy
[testenv]
... |
What about an option |
Just having an example of how to do it right does not inform users about nuanced behaviors when they deviate from the example.¹ Even this would be better: [tox]
# gh-actions only has access to environments explicitly listed in envlist
envlist = py38, py39, py310, mypy
[gh-actions]
python =
# note that py37 and py38-legacy will silently never be run because they are missing from envlist
3.7: py37
3.8: py38, py38-legacy
3.9: py39
3.10: py310, mypy
[testenv]
... I like the ¹ Assuming otherwise is typical by people already familiar with the behaviors in question, but often flawed. Those people are not the audience of documentation. The mere existence of this issue is evidence that your assumptions deserve revisiting. Further, if you can solve your user's difficulty with poor ergonomics by improving ergonomics, that's almost always a better solution than relying on secondary sources like documentation. |
Thanks for sharing additional feedback. Adding an option to fail should be possible but let me think about it a bit deeper before actually implementing it as tox-gh-actions hasn't provided any CLI options so far. |
If it is easier, then maybe some environment variable could be used? |
Sorry for a slow response but I just published tox-gh-actions v2.12.0 which adds an option to fail when no environments are matched. Please check details in README and give it a try: https://github.com/ymyzk/tox-gh-actions/blob/v2.12.0/README.md#fail-when-no-environments-are-matched Thank you all for your patience! |
It took me a while to realize I had the same issue as #44.
I think the run should fail if the resulting
envlist
is empty, that way one doesn't accidentally think the action succeeded when nothing was actually done.The text was updated successfully, but these errors were encountered: