tox -e py 37 doesnt pickup glance tests
Hi,
Could you please suggest how to fix the below error:
py37 run-test-pre: PYTHONHASHSEED=
py37 run-test: commands[0] | stestr slowest
/Users/
class ChainMap(
/Users/
import imp
ERROR: InvocationError for command /Users/
_______
ERROR: py37: commands failed
Glance/stein tests are picked up with tox -e py27.
Regards,
Rajiv
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Glance Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
I can't reproduce this. When I do:
git checkout master
git fetch --all
git pull origin master
tox -r -e py37
I get:
======
Totals
======
Ran: 1853 tests in 9.0883 sec.
- Passed: 1835
- Skipped: 18
- Expected Fail: 0
- Unexpected Success: 0
- Failed: 0
Sum of execute time for each test: 67.7211 sec.
(Note the '-r' option to tox ... it rebuilds the virtualenv, maybe you are running with an outdated env?)
Revision history for this message
|
#2 |
I rebuilt the env, executed the above:
ource ~/virtualenvs/
(glance-stein) C02T8EARGTFM:
M tox.ini
Already on 'master'
Your branch is up to date with 'origin/master'.
(glance-stein) C02T8EARGTFM:
Fetching origin
(glance-stein) C02T8EARGTFM:
From https:/
* branch master -> FETCH_HEAD
Already up to date.
(glance-stein) C02T8EARGTFM:
py37 recreate: /Users/
py37 installdeps: -r/Users/
py37 develop-inst: /Users/
py37 installed: /Users/
py37 run-test-pre: PYTHONHASHSEED=
py37 run-test: commands[0] | stestr slowest
/Users/
class ChainMap(
/Users/
import imp
ERROR: InvocationError for command /Users/
_______
ERROR: py37: commands failed
We run our infra on k8s containers, when i run the below, the tests are being picked up:
kubectl run -i glance-
y36 develop-inst: /glance
py36 installed: alabaster=
py36 run-test-pre: PYTHONHASHSEED=
py36 run-test: commands[0] | find . -type f -name '*.pyc' -delete
_______
py36: commands succeeded
congratulations :)
Revision history for this message
|
#4 |
Not sure what's going on, here are a few guesses:
1. When you did the 'git checkout master', it said that your tox.ini was modified. Do a 'git diff' to see what the difference is.
2. My output has the line:
py37 runtests: commands[0] | stestr run --slowest
whereas yours has
py37 run-test: commands[0] | stestr slowest
the stuff before the '|' is coming from tox; maybe it's a tox version problem? (I'm using 3.4.0). I wonder if you're using an older tox; you do a 'pip install tox' when you run the py36 tests in the container, which would give you the newest version of tox, maybe that's why the tests run in the container.
the stuff after the '|' is defined in tox.ini (could be that's the diff in your tox.ini?)
Revision history for this message
|
#5 |
1) Difference was i restricted `envlist to py37`
2) Good and bad news:
GOOD News:
Post implementing the above changes in tox.ini i.e.
a) downgrade to tox==3.4.0 it works fine
b) change ostestr to stestr run --slowest
BAD News:
a) I am using the latest tox version, Stein doesnt support tox v3.12.1 ?
b) why hasnt there been any changes to https:/
======
Totals
======
Ran: 1853 tests in 12.0599 sec.
- Passed: 1852
- Skipped: 0
- Expected Fail: 0
- Unexpected Success: 0
- Failed: 1
Sum of execute time for each test: 105.8513 sec.
glance.
glance.
glance.
ERROR: InvocationError for command '/glance/
_______
ERROR: py36: commands failed
Not sure, what i am missing now, any suggestions ?
Revision history for this message
|
#6 |
i get the below when i run stestr run:
======
Totals
======
Ran: 1853 tests in 12.9945 sec.
- Passed: 1853
- Skipped: 0
- Expected Fail: 0
- Unexpected Success: 0
- Failed: 0
Sum of execute time for each test: 118.6251 sec.
Revision history for this message
|
#7 |
To sum-up the above:
For me all tests pass with tox==3.4.0 and stestr run stestr run {posargs}. How do you suggest i go forward ?
Regards,
Rajiv
Revision history for this message
|
#8 |
Hi Brian,
Any update? is this a bug in latest tox release ?
Regards,
Rajiv
Revision history for this message
|
#9 |
I don't think this a tox bug. I can get the tests to run fine with tox 3.4.0 and tox 3.9.0
Glance stable/stein still uses os-testr:
https:/
so these lines are correct in stable/stein tox.ini:
https:/
I can run the tests fine locally:
[master] wha'ppen? git fetch --all
Fetching origin
Fetching gerrit
[master] wha'ppen? git checkout stable/stein
Switched to branch 'stable/stein'
Your branch is up to date with 'origin/
[stable/stein] wha'ppen? git lg -n 1
f7723218 3 months ago (HEAD -> stable/stein, origin/
[stable/stein] wha'ppen? tox -r -e py37
py37 recreate: /home/brosmait/
py37 installdeps: -r/home/
py37 develop-inst: /home/brosmait/
py37 installed: /home/brosmait/
py37 run-test-pre: PYTHONHASHSEED=
py37 runtests: commands[0] | ostestr --slowest
[snip]
======
Totals
======
Ran: 1853 tests in 10.6932 sec.
- Passed: 1835
- Skipped: 18
- Expected Fail: 0
- Unexpected Success: 0
- Failed: 0
Sum of execute time for each test: 73.7338 sec.
==============
Worker Balance
==============
- Worker 0 (223 tests) => 0:00:10.237251
- Worker 1 (232 tests) => 0:00:09.045271
- Worker 2 (232 tests) => 0:00:09.263069
- Worker 3 (233 tests) => 0:00:08.680933
- Worker 4 (233 tests) => 0:00:10.261483
- Worker 5 (233 tests) => 0:00:09.361644
- Worker 6 (233 tests) => 0:00:09.446217
- Worker 7 (234 tests) => 0:00:09.217904
Slowest Tests:
Test id Runtime (s)
-------
glance.
glance.
glance.
glance.
glance.
glance.
glance.
glance.
glance.
glance.
_______
py37: commands succeeded
congratulations :)
I suspect there's some kind of problem with your environment. Make sure that your stable/stein tox.ini is exactly like the one in the git repository for stable/stein and try again.
If you still have problems, you can file a Glance bug explaining the problem and propose a backport to stable/stein of the commit that removed os-testr in master:
https:/
(Note: you'll get a conflict when you backport that patch; there's not a py36 environment in stable/stein tox.ini, so don't include it in the backport.)
I don't know what the odds are of the stable-maint team accepting the backport; as far as I can tell, everything is working in stable/stein right now. One argument you could make is that stable/stein is using os-testr for unit tests and stestr for functional tests, it would be better to be consistent. I don't know if that's a good argument for a backport, though. So it will depend on what you can figure out about why the tests won't run in your containerized environment, and whether this problem will prevent us from backporting other changes to stable/stein (all the tests have to pass for backport to be accepted).
I did the cherry-pick I described above locally, and it doesn't seem to break anything; but on the other hand, nothing seems to be broken now, and the stable-maint team tends to be very conservative about allowing changes into the stable branches.
Can you help with this problem?
Provide an answer of your own, or ask Rajiv Mucheli for more information if necessary.