fix: ensure the appropriate error message is produced when the RunOnFailure() option is used.#132
Open
machine424 wants to merge 1 commit intouber-go:masterfrom
Open
fix: ensure the appropriate error message is produced when the RunOnFailure() option is used.#132machine424 wants to merge 1 commit intouber-go:masterfrom
machine424 wants to merge 1 commit intouber-go:masterfrom
Conversation
…ailure() option is used. adjust RunOnFailure() doc. follow up to uber-go#129
machine424
commented
Oct 10, 2024
| if opts.cleanup != nil { | ||
| return errors.New("Cleanup can only be passed to VerifyNone or VerifyTestMain") | ||
| } | ||
| if opts.runOnFailure { |
Author
There was a problem hiding this comment.
This will also block its use in VerifyTestMain
I adjusted the doc to mention this has no effect on VerifyNone
keeping/adding a check in the code would require more effort/changes.
Author
|
cc @sywhang |
Merged
machine424
commented
Oct 10, 2024
| VerifyTestMain(dummyTestMain(7), RunOnFailure()) | ||
| assert.Equal(t, 7, <-exitCode, "Exit code should not be modified") | ||
| assert.Contains(t, <-stderr, "goleak: Errors", "Find leaks on unsuccessful runs with RunOnFailure specified") | ||
| assert.Contains(t, <-stderr, "goleak: Errors on unsuccessful test run", "Find leaks on unsuccessful runs with RunOnFailure specified") |
Author
There was a problem hiding this comment.
goleak: Errors wasn't enough as it was hiding RunOnFailure can only be passed to VerifyTestMain in this case.
Author
|
cc @sywhang I'd like to get this fix merged so we can make use of the feature. |
Author
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adjust RunOnFailure() doc.
follow up to #129