-
Notifications
You must be signed in to change notification settings - Fork 4
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
pytest with randomly via tox #28
pytest with randomly via tox #28
Conversation
When running python interpreter directly, it may create __pycache__ sub-directories. Ignore those. Signed-off-by: Shachar Sharon <ssharon@ibm.com>
Have top-level 'conftest.py' for pytest's fixtures [1], to allow sharing fixtures across multiple files. Begin with an empty file and content as needed. [1] https://docs.pytest.org/en/7.4.x/reference/fixtures.html Signed-off-by: Shachar Sharon <ssharon@ibm.com>
Use tox to run pytests with all its dependencies. In particular configure tox to run pytest using pytest-randomly[1] to have better control on random seed and allow reproducing tests seed. Signed-off-by: Shachar Sharon <ssharon@ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM generally, I'm just not entirely sure why "pytest" and "sanity" are separate envs, since there appears to be overlap between them. I approve, but would like to add a comment/documentation on what each env is meant to accomplish.
It preserves the current existing logic in top-level |
OK, thanks. I overlooked that was already the case. My general suggestion to document these different cases still stands, but not for this PR. :-) |
Prefer tox with all its glory over raw shell command. Use top-level Makefile as an easy wrapper over tox. Assuming tox is already installed on local-host/local-user. Signed-off-by: Shachar Sharon <ssharon@ibm.com>
ed03976
to
f9780c6
Compare
retest this please |
@synarete , we may need to install tox on the test system in sit-environment before we can commit this change. From the console output of the test failure.
|
Indeed. For CentOS8 this is not an option due to old Python version. For CentOPS9-stream it should be fine. Do you think we should install it a rpm package on host or per user with |
4c53137
to
f9780c6
Compare
/retest all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK - but one caveat. We introduce conftest.py but it is never populated. Should we hold on introducing the file until we actually want to add some pytest conf?
This is a known issue and not affected by the changes here. The only difference is that the order in which the tests were run has changed. This is expected as part of the pytest-randomly use. |
/retest all |
Use tox to run pytest. Use pytest-randomly to have better control on random seed upon re-run due to test failure.