-
Notifications
You must be signed in to change notification settings - Fork 275
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
logging in test runner / CI : higher log level but only print failing tests #1120
Comments
Fix the aggregate_tests.py TextTestRunner buffering so that output from failing tests is now printed below the failure. This is done by adding a logging handler that allows TextTestRunner to modify sys.stderr value between tests. aggregate_tests.py now accepts the same verbosity flag as individual test files (e.g. '-vvv' for DEBUG level). tox sets '-vvv' so failing tests will now get DEBUG output: this probably makes sense on CI at least. Fixes theupdateframework#1120 Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
Fix the aggregate_tests.py TextTestRunner buffering so that output from failing tests is now printed below the failure. This is done by adding a logging handler that allows TextTestRunner to modify sys.stderr value between tests. aggregate_tests.py now accepts the same verbosity flag as individual test files (e.g. '-vvv' for DEBUG level). tox sets '-vvv' so failing tests will now get DEBUG output: this probably makes sense on CI at least. Fixes theupdateframework#1120 Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
Fix the aggregate_tests.py TextTestRunner buffering so that output from failing tests is now printed below the failure. This is done by adding a logging handler that allows TextTestRunner to modify sys.stderr value between tests. aggregate_tests.py now accepts the same verbosity flag as individual test files (e.g. '-vvvv' for DEBUG level). tox sets '-vvv' so failing tests will now get INFO output: this probably makes sense on CI at least. Fixes theupdateframework#1120 Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
I have a commit for this (see link above) but it might require some discussion and work:
I should maybe make a draft PR of this and make some tests fail to showcase this... |
We cannot assess how all developers are using tox, but probably the best we can do is to ask that on a tuf meeting.
Another reason why we want locally to have a log level above
Yes, I have encountered that problem multiple times. Have you searched if that's a known issue for this module? |
bugs.python.org is not the easiest to search in but I haven't seen a bug |
We should do what in-toto does: have the test runner output much more logging but only for failing tests. This should be especially useful for CI but also for developers.
Assuming we hard-code a good log level (see #1093 for potential alternatives), I think we only need roughly this in aggregate_tests.py:
This is because the testrunner buffering will not work with long lived loggers otherwise: the default handler caches
sys.stderr
value and testrunner wants to modify it between test runs (and buffering is required to only print the failing test output).The text was updated successfully, but these errors were encountered: