Replies: 7 comments
-
so in the end I sort of went a different way and just put the CI environments in the envlist and I'll work around the issues with distro packaging on that end. But I'm still curious about this. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for sharing your usage. The difficulty comes from the fact that When the following [tox]
envlist = py{27,36,37,38,39}
[gh-actions]
python =
2.7: py27
3.6: py36-ci
3.7: py37-ci
3.8: py38-ci
3.9: py39-ci
[testenv]
deps =
-r{toxinidir}/install.requires
-r{toxinidir}/tests.requires
ci: -r{toxinidir}/ci.requires
commands =
py.test
ci: py.test --cov-report term-missing --cov-report xml --cov openqa_client
ci: diff-cover coverage.xml --fail-under=90
ci: diff-quality --violations=pylint --fail-under=90
setenv =
PYTHONPATH = {toxinidir} We cannot see the environment like
But we can see
|
Beta Was this translation helpful? Give feedback.
-
One solution is specifying a list of environments explicitly when running tox on GitHub Actions: [tox]
envlist = py{27,36,37,38,39}
[gh-actions]
python =
2.7: py27
3.6: py36-ci
3.7: py37-ci
3.8: py38-ci
3.9: py39-ci
[testenv]
deps =
-r{toxinidir}/install.requires
-r{toxinidir}/tests.requires
ci: -r{toxinidir}/ci.requires
commands =
py.test
ci: py.test --cov-report term-missing --cov-report xml --cov openqa_client
ci: diff-cover coverage.xml --fail-under=90
ci: diff-quality --violations=pylint --fail-under=90
setenv =
PYTHONPATH = {toxinidir} jobs:
build:
steps:
- name: Test with tox
run: tox -e py36-ci,py37-ci,py38-ci,py39-ci |
Beta Was this translation helpful? Give feedback.
-
thanks for looking into it! yeah, I noticed the same thing about tox not listing the environment. it's quite hard to be sure exactly what behaviour tox 'intends' with regard to environment definitions, really - I don't know if this kind of 'implicit' environment is even really intended to work or if it's just a sort of side effect. |
Beta Was this translation helpful? Give feedback.
-
Me neither. It may be documented in the tox's documentation but I couldn't find it so far. Sadly, this is something difficult to fix/support by changing this plugin's code. Do you mind closing this ticket? |
Beta Was this translation helpful? Give feedback.
-
no, if it's too difficult to fix that's fine. thanks for looking into it. |
Beta Was this translation helpful? Give feedback.
-
I really think tox-gh-actions does a bad job stopping users from doing things that are against its design. The [gh-actions]
python =
2.7: py27
3.6: py36-ci ; <-- this line is invalid, the plugin should abort
... CI Plugins should be dumbAlready in the old days of tox-travis that plugin was meant to turn an execution of CI plugins like tox-travis and tox-gh-actions should be dumb. As dumb as possible, for what it makes sense. They should only run Tox, based on simple rules that populate If you want more you should configure Tox itself, not the plugin for GHA. |
Beta Was this translation helpful? Give feedback.
-
I'm currently trying to set this up for a repo, but I'm having a bit of trouble with one specific thing.
It seems this can't handle environments that aren't in
envlist
?The idea here is that I want to have
-ci
environments which aren't used if you just runtox
normally. They're only used when explicitly specified. That's why I don't want to put them inenvlist
: whatever you put inenvlist
is what will be run if you just runtox
with no-e
argument, and there's no way to change this, so far as I can tell.The config I have:
works fine when I test from the command line. If I just run
tox
, thepy27
,py36
etc. environments - which don't run the CI commands - are run. If I runtox -epy{27,36,37,38,39}-ci
, tox runs the CI environments and commands.But if you look at the test results in the pull request, this doesn't seem to be working there. In
tox.ini
I configured all the Python 3 environments as I actually want them to be set up:but it seems like when tox-gh-actions goes to run these, it just sort of does nothing:
I set the Python 2.7 line to use the non-CI environment, as a check:
and just that environment works correctly:
which is what makes me think the problem is running an environment that's not in envlist...
Beta Was this translation helpful? Give feedback.
All reactions