Skip to content
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

Merged
merged 7 commits into from
Nov 24, 2020

Conversation

ycombinator
Copy link
Contributor

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 and TearDown) as well as to informational methods (Type and String).

Related: #175 (comment)
Related: #168

@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 23, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #180 updated]

  • Start Time: 2020-11-24T07:01:00.488+0000

  • Duration: 8 min 7 sec

Test stats 🧪

Test Results
Failed 0
Passed 9
Skipped 0
Total 9

Copy link
Contributor

@mtojek mtojek left a 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() {
Copy link
Contributor

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.

Copy link
Contributor Author

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.


// TearDown cleans up any test runner resources. It must be called
// after the test runner has finished executing.
TearDown()
Copy link
Contributor

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?

Copy link
Contributor Author

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!

Copy link
Contributor Author

@ycombinator ycombinator Nov 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 18bb93e.

@ycombinator ycombinator merged commit 0ffcd94 into elastic:master Nov 24, 2020
@ycombinator ycombinator deleted the refactoring-test-runner branch November 24, 2020 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants