-
Notifications
You must be signed in to change notification settings - Fork 3k
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 the Python test log less messy #5456
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
SpecLad
force-pushed
the
improve-test-output
branch
from
December 13, 2022 10:21
aef51ab
to
ed338b0
Compare
3 tasks
This suppresses "variable is not set" warnings that docker-compose shows when you don't set those variables.
This makes the test output less messy. Fixtures are only created after the first test starts running, so `docker-compose` output becomes intermixed with the test log. The hooks, on the other hand, run before the tests are even collected, so the output is separated from the test log. This also makes runs with options like `--stop-services` a bit faster, because pytest doesn't have to waste time collecting tests that won't even be run.
SpecLad
force-pushed
the
improve-test-output
branch
from
December 16, 2022 14:01
ed338b0
to
1f46d20
Compare
nmanovic
approved these changes
Dec 16, 2022
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
2 tasks
nmanovic
pushed a commit
that referenced
this pull request
Jan 5, 2023
Turns out that #5456 had a nasty side effect. Session hooks are called when pytest is run with `--collect-only` (even though no tests are actually run in this case), and Visual Studio Code periodically runs `pytest --collect-only` in order to learn what tests exist in the project. As a result, it keeps restarting the services and restoring the database in the background. Work around this by skipping all logic in the hooks if `--collect-only` is in the options.
mikhail-treskin
pushed a commit
to retailnext/cvat
that referenced
this pull request
Jul 1, 2023
mikhail-treskin
pushed a commit
to retailnext/cvat
that referenced
this pull request
Jul 1, 2023
…ai#5550) Turns out that cvat-ai#5456 had a nasty side effect. Session hooks are called when pytest is run with `--collect-only` (even though no tests are actually run in this case), and Visual Studio Code periodically runs `pytest --collect-only` in order to learn what tests exist in the project. As a result, it keeps restarting the services and restoring the database in the background. Work around this by skipping all logic in the hooks if `--collect-only` is in the options.
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.
See the individual commits for more information.
Motivation and context
I don't want to keep seeing warnings and interleaved docker-compose/pytest output each time I run the tests.
How has this been tested?
By running the tests. 🙂
Checklist
develop
branch[ ] I have added a description of my changes into CHANGELOG file[ ] I have updated the documentation accordingly[ ] I have added tests to cover my changes[ ] I have linked related issues (read github docs)[ ] I have increased versions of npm packages if it is necessary (cvat-canvas,cvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.