-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
junit-xml: add option for disabling logs for passed tests #4559
Copy link
Copy link
Closed
Labels
plugin: junitxmlrelated to the junitxml builtin pluginrelated to the junitxml builtin pluginstatus: help wanteddevelopers would like help from experts on this topicdevelopers would like help from experts on this topictype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: feature-branchnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Metadata
Metadata
Assignees
Labels
plugin: junitxmlrelated to the junitxml builtin pluginrelated to the junitxml builtin pluginstatus: help wanteddevelopers would like help from experts on this topicdevelopers would like help from experts on this topictype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: feature-branchnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Type
Fields
Give feedbackNo fields configured for issues without a type.
We have near 130k tests for some web-API, and in these tests we log a lot of http requests with its request/response headers, data, query and etc. We are logging it with logging module (
logging.getLogger('api_logger')). There is a lot of logs, really. We are using Jenkins to run these tests and--junit-xmloption for creating junit-xml style report.So the problem is connected with junit-xml creation. Junit-xml reporter captures not only failed tests (<1%) but passed tests too (>99%) and it can crash the Jenkins process and freeze the runner-server for a while.
There are some ways to disable logs for failed tests like:
--show-capture=noControls how captured stdout/stderr/log is shown on failed tests. Default is 'all',--no-print-logsdisable printing caught logs on failed tests,but no possibility to disable logs for passed test.
Right now we handle this with custom
pytest_runtest_logreportthat checksif report.failed and report.when == 'call'So, maybe pytest needs an option for junit-xml that disables logs for passed tests and logs only failed, what do you think?