-
Notifications
You must be signed in to change notification settings - Fork 116
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
Refactoring test runner #180
Refactoring test runner #180
Conversation
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.
The CI failed, but I believe it's not related to these changes. Nice job!
return r.run() | ||
} | ||
|
||
func (r runner) TearDown() { |
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.
nit: it may be hard to debug issues with TearDown if it starts to depend on state and it's not r *runner)
anymore.
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.
Changed to pointer receivers in 7de930c.
internal/testrunner/testrunner.go
Outdated
|
||
// TearDown cleans up any test runner resources. It must be called | ||
// after the test runner has finished executing. | ||
TearDown() |
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.
is it fair for TearDown
method to return an error?
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, I had it returning an error at one point but looking at the current implementations of TearDown
, none of them actually return an error so I took it out.
But, since you're also thinking about it, I'm once again leaning towards allowing TearDown
to return an error. I will add it back, thanks!
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.
Added in 18bb93e.
This PR defines a
TestRunner
interface. All test runners must implement this interface. This will give consumers of test runners access to their lifecycle methods (Run
andTearDown
) as well as to informational methods (Type
andString
).Related: #175 (comment)
Related: #168