-
Notifications
You must be signed in to change notification settings - Fork 153
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
fix: ensure the appropriate error message is produced when the RunOnFailure() option is used. #132
base: master
Are you sure you want to change the base?
Conversation
…ailure() option is used. adjust RunOnFailure() doc. follow up to uber-go#129
@@ -59,9 +59,6 @@ func Find(options ...Option) error { | |||
if opts.cleanup != nil { | |||
return errors.New("Cleanup can only be passed to VerifyNone or VerifyTestMain") | |||
} | |||
if opts.runOnFailure { |
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.
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.
cc @sywhang |
@@ -69,11 +69,15 @@ func TestVerifyTestMain(t *testing.T) { | |||
|
|||
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") |
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.
goleak: Errors
wasn't enough as it was hiding RunOnFailure can only be passed to VerifyTestMain
in this case.
cc @sywhang I'd like to get this fix merged so we can make use of the feature. |
adjust RunOnFailure() doc.
follow up to #129