Skip to content

Conversation

@stevenfontanella
Copy link
Member

@stevenfontanella stevenfontanella commented Dec 20, 2025

  • Print all failed test stdouts/stderrs at the end so that the output isn't lost among the successful tests
  • Make shared.options.abort_on_first_failure work with the spec test suite and add aliases for --fail-fast and --no-fail-fast
  • Re-raise in run_one_spec_test since fail_with_error may no longer throw an exception when abort_on_first_failure is false (the remaining code shouldn't execute because then actual isn't defined).

With --no-fail-fast:
image

With --fail-fast (the default):
image

@stevenfontanella stevenfontanella marked this pull request as ready for review December 20, 2025 23:41
Copy link
Member

@sbc100 sbc100 left a 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.
'''
Copy link
Member

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',
Copy link
Member

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():
Copy link
Member

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.

@sbc100
Copy link
Member

sbc100 commented Dec 21, 2025

Another nice addition (ideas for followups).

  1. Print the number of failing tests.
  2. Print the test number and progress with each result. e.g. [N/M] test_name..

Even better, only print this single-line status (i.e. no stdout from the test) unless --verbose or the test fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants