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

Make parametrized tests xdist-compatible #4

Closed
abalakh opened this issue Feb 20, 2018 · 3 comments
Closed

Make parametrized tests xdist-compatible #4

abalakh opened this issue Feb 20, 2018 · 3 comments
Assignees

Comments

@abalakh
Copy link
Contributor

abalakh commented Feb 20, 2018

Issue by abalakh
Monday Feb 19, 2018 at 12:34 GMT
Originally opened as abalakh/airgun#22


(robottelo issue)
Currently test runs with parametrized tests using xdist are failing with msgs like:

collecting 0 items / 3 errors
==================================== ERRORS ====================================
_____________________________ ERROR collecting gw1 _____________________________
Different tests were collected between gw0 and gw1. The difference is:

This is due to random data generated inside parametrize. We should probably use the same hash seed across different workers. More info here: pytest-dev/pytest#1075

@abalakh
Copy link
Contributor Author

abalakh commented Feb 22, 2018

Apart from using the same hash seed we can stop sending random data in test names - instead of test_positive_create[dfh7yt94hf9] introduce names for datafactory values, so tests will always be named like test_positive_create[alphanumeric], test_positive_create[utf-8] etc. That's even better naming and it will also avoid encountering such issue.

@omaciel
Copy link
Member

omaciel commented Feb 22, 2018

I like your suggestion @abalakh and it does make it easier to see what type of data was passed (the actual value can always be gotten by looking at logs, if needed)

@abalakh
Copy link
Contributor Author

abalakh commented Apr 5, 2018

Addressed in SatelliteQE/robottelo#5904 , you can see updated names in the test results there:

[...]
tests/foreman/ui_airgun/test_activationkey.py::test_positive_create_with_envs[alphanumeric] PASSED [ 22%]
tests/foreman/ui_airgun/test_architecture.py::test_positive_create[alphanumeric] PASSED [ 36%]
tests/foreman/ui_airgun/test_architecture.py::test_positive_delete[alpha] PASSED [ 45%]
tests/foreman/ui_airgun/test_operatingsystem.py::test_positive_create[numeric] PASSED [ 68%]
[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants