-
Notifications
You must be signed in to change notification settings - Fork 6
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
added --run-tests open in pytest #2085
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
samtygier-stfc
requested changes
Mar 7, 2024
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.
This works well, thanks.
Possible small tweak. If you could add the path to the system tests to the end of the line in make file rule, so that it it only collects those and does not print out so many skip messages.
${XVFBRUN} python -m pytest -vs -rs -p no:xdist -p no:randomly -p no:repeat -p no:cov -o log_cli=true --run-system-tests mantidimaging/gui/test/
samtygier-stfc
approved these changes
Mar 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Closes #2082.
Closes #1906.
Description
On Windows, running
python -m pytest -n auto
was running the system tests and the screenshot eyes tests instead of just the "normal" tests.A
--run-unit-tests
option is now available with pytest to explicitly only run the unittests by not collecting theeyes_tests
and thesystem-tests
. This functionality should be robust against future added tests.You can also exclude the unit tests from pytest by not using the
--run-unit-tests
option.--run-unit-tests
has been included into the makefile such that runningmake test
should only run the unittest and not the system tests or screenshot eyes tests. These can be run withmake test-system
andmake test-screenshots
(or on windows:make test-screenshots-win
) respectively. The--ignore=<Path>
can now be used along with custom flags to explicitly exclude certain paths or tests in the collection phase ofpytest
.Acceptance Criteria
run the following and make sure that the appropriate tests ran as expected:
make test
make test-verbose
make test-system
make test-screenshots
ormake test-screenshots-win
make check
--ignore=<path>
flag along with a custom flag to check it works as expected, e.g.python -m pytest --run-unit-tests --ignore=mantidimaging/core
NOTE: running
--run-eyes-tests
will only work if the API local key is correctly set up. This can be done via the command line on linux but is done via the environment variables in Windows. The environment variables are taken care of in the makefile so runningmake test-screenshots-win
should run the eyes tests locally on windows.Documentation
Will add to Developer release notes