-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
System tests: assert(): friendlier failure messages #17538
System tests: assert(): friendlier failure messages #17538
Conversation
@Luap99 PTAL. I encourage you to recreate the problems you were seeing (if that's easy) and see if the new error message is easier to understand. |
0f95309
to
9044559
Compare
...safer, too: the big change is using 'mapfile' to split multiline strings; this preserves empty lines, making it easy to see spurious (or missing) blank lines in output. Another change is to indent the expected-output string consistently, for readability. Then, to handle \r (CR) and other control characters, use bash %q to format special chars. But %q makes\ it\ hard\ to read\ lines\ with\ spaces, so strip off those backslashes. This makes assert() much larger and uglier, but this is code that shouldn't be touched often. Finally, because these are big changes to critical code, write a complicated regression test suite for assert(). Signed-off-by: Ed Santiago <[email protected]>
9044559
to
c81fbd5
Compare
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
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
I tested it by adding some special chars to podman logs and the test failure clearly showed them
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, Luap99, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
...safer, too: the big change is using 'mapfile' to split
multiline strings; this preserves empty lines, making it
easy to see spurious (or missing) blank lines in output.
Another change is to indent the expected-output string
consistently, for readability.
Then, to handle \r (CR) and other control characters, use
bash %q to format special chars. But %q makes\ it\ hard\ to
read\ lines\ with\ spaces, so strip off those backslashes.
This makes assert() much larger and uglier, but this is
code that shouldn't be touched often.
Finally, because these are big changes to critical code,
write a complicated regression test suite for assert().
Closes: #17509
Signed-off-by: Ed Santiago [email protected]