-
Notifications
You must be signed in to change notification settings - Fork 97
More precise logging in CI #734
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
Conversation
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.
Are you telling me we overrode the default behavior in favor of the worse option?
🙏 yay for the change
I'd say so. Maybe it wasn't as bad in the early days of the repo. |
44a54da
to
16855fa
Compare
16855fa
to
9cbf307
Compare
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.
Nothing blocking
log_cli = true | ||
log_cli_level = "INFO" | ||
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)" | ||
# Do not use log_cli since this shows logging for all tests, not just the ones | ||
# that failed. Instead, show all logs for failed tests at the end. | ||
log_level = "DEBUG" | ||
log_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)" |
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.
Near the bottom of the README there is:
For example, here's how to run a single test with debug logs on the console:
poe test -s --log-cli-level=DEBUG -k test_sync_activity_thread_cancel_caught
I admit I use this a lot during development on passing tests (I put this at the bottom of the README on .NET and Ruby too because I forget the args going from one to the other). Will this still work or does this need to be updated now to enable CLI logging?
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.
In general, CI test logs should:
Make it easy to see which tests have failed
Help understand how they have failed
To that end, they should:
Include minimal output for tests that pass
Include full output for tests that fail (should not be many)
Previously we were using pytest's
log-cli
feature, which outputs logs for all tests as the tests are run. This PR stops using that, instead switching to a config that outputs all logging output >= DEBUG for failed tests, at the end of the test run (search for=================================== FAILURES ===================================
).See https://docs.pytest.org/en/stable/how-to/logging.html#logging.