-
Notifications
You must be signed in to change notification settings - Fork 830
Print failed test results at the end for the spec test suite #8154
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
base: main
Are you sure you want to change the base?
Conversation
6925ad4 to
8f2f91d
Compare
sbc100
left a comment
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.
Awesome!
| ''' | ||
| Returns (bool, str) where the first element is whether the test was | ||
| successful and the second is the combined stdout and stderr of the test. | ||
| ''' |
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.
The standard format for docstrings is to use tripple-double-quotes, and to include the first line of text on the opening line.
| help='Disables running the torture testcases.') | ||
| parser.add_argument( | ||
| '--abort-on-first-failure', dest='abort_on_first_failure', | ||
| '--abort-on-first-failure', "--fail-fast", dest='abort_on_first_failure', |
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.
Single quotes here.
Also, I think we can just remove the old name here... the number folks who run this script is small enough we don't need to worry about back compat.
Also, you can use argparse.BooleanOptionalAction here maybe?
| if not failed_stdouts: | ||
| return | ||
|
|
||
| with red_stdout(): |
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.
I would maybe combine theese:
if failed_stdouts:
with red_stdout():
...
I guess early return is good.. but in this case there is only one following block.
|
Another nice addition (ideas for followups).
Even better, only print this single-line status (i.e. no stdout from the test) unless |
shared.options.abort_on_first_failurework with the spec test suite and add aliases for --fail-fast and --no-fail-fastactualisn't defined).With

--no-fail-fast:With

--fail-fast(the default):