-
Notifications
You must be signed in to change notification settings - Fork 33
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
Reuse subunit_trace output/validation logic for load/run #333
Conversation
Previously `stestr run` and subunit_trace used slightly different output and validation logic. run wouldn't catch the case where a test exited without a status, while code using `last` and `history` would since they used subunit_trace. Refactor the subunit_trace output and validation logic and use it for `load`/`run`. Converge on the subunit_trace formatted output, in addition to the summary also show if something goes wrong. The primary motivation for this change is to better detect when a subprocess is killed and not all tests are run as expected (segfault, OOM etc.).
if post_fails: | ||
print_fails(stdout) | ||
if not no_summary: | ||
print_summary(stdout, elapsed_time) | ||
|
||
# NOTE(mtreinish): Ideally this should live in testtools streamSummary | ||
# this is just in place until the behavior lands there (if it ever does) | ||
if count_tests("status", "^success$") == 0: | ||
if count_tests("status", "^xfail$") + count_tests("status", "^success$") == 0: |
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.
figured this is easier to read than join the two regex
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.
yeah, that's fine I think the regex would just be ^xfail|success$
or something like that, but this is definitely more legible.
Codecov Report
@@ Coverage Diff @@
## main #333 +/- ##
==========================================
+ Coverage 61.48% 61.69% +0.21%
==========================================
Files 30 30
Lines 2630 2624 -6
Branches 472 472
==========================================
+ Hits 1617 1619 +2
+ Misses 888 883 -5
+ Partials 125 122 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM, thanks for the fix
if post_fails: | ||
print_fails(stdout) | ||
if not no_summary: | ||
print_summary(stdout, elapsed_time) | ||
|
||
# NOTE(mtreinish): Ideally this should live in testtools streamSummary | ||
# this is just in place until the behavior lands there (if it ever does) | ||
if count_tests("status", "^success$") == 0: | ||
if count_tests("status", "^xfail$") + count_tests("status", "^success$") == 0: |
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.
yeah, that's fine I think the regex would just be ^xfail|success$
or something like that, but this is definitely more legible.
Previously
stestr run
and subunit_trace used slightly different output and validation logic. run wouldn't catch the case where a test exited without a status, while code usinglast
andhistory
would since they used subunit_trace.Refactor the subunit_trace output and validation logic and use it for
load
/run
.Converge on the subunit_trace formatted output, in addition to the summary also show if something goes wrong.
The primary motivation for this change is to better detect when a subprocess is killed and not all tests are run as expected (segfault, OOM etc.).