checks: make suite failure reporting configurable#2418
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a configurable max_reported_failures parameter to the Suite and SuiteResult classes, allowing users to control the number of failed scenarios displayed in reports. The default is set to 20, and the logic in rich_console has been updated to respect this setting. Feedback includes suggestions to allow a minimum value of 0 for complete suppression of failure details, refactoring duplicated logic in the reporting output, and merging redundant imports in the test suite.
davidberenstein1957
left a comment
There was a problem hiding this comment.
instead of this argument, could you define this as an overridable environment variable and simplify the code implementation and tests?
|
@harsh21234i could you resolve the conflict please? |
|
I kept both the SuiteResult failure-reporting tests from this PR and the newer upstream parallel suite tests. I also |
d7dbacd to
b19f843
Compare
| except ValueError: | ||
| return DEFAULT_MAX_REPORTED_FAILURES | ||
|
|
||
| return max(0, value) |
There was a problem hiding this comment.
I would allow -1 as unlimited, and make DEFAULT_MAX_REPORTED_FAILURES -1.
I'll create a separate issue for this
#2417
Summary
This PR makes
SuiteResultfailure reporting configurable instead of hard-coding the rich-report output to 20 failed/erroredscenarios.
Changes
max_reported_failurestoSuitewith a default of20max_reported_failurestoSuiteResultwith support forNoneto show all failuresSuite.run()to propagate the configured value into the returnedSuiteResultSuiteResult.__rich_console__to honor the configured limit in both the detailed and summary sectionsSuite.run()None