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

[Docker Log driver] Expand testing, add mocking tooling #14828

Conversation

fearful-symmetry
Copy link
Contributor

This adds a 'main' integration test for the client handler and log reader, as well as a set of tools for mocking the publisher pipeline. A few things have shifted around in the client/pipeline managers in order to make testing easier.

@fearful-symmetry fearful-symmetry added the Team:Integrations Label for the Integrations team label Nov 27, 2019
@fearful-symmetry fearful-symmetry requested review from a team November 27, 2019 19:56
@fearful-symmetry fearful-symmetry self-assigned this Nov 27, 2019
@fearful-symmetry fearful-symmetry force-pushed the dockerbeat-testing-additional branch from 555480c to da26d09 Compare November 27, 2019 20:00
@mtojek
Copy link
Contributor

mtojek commented Nov 28, 2019

Only some nit picks, LGTM!

@fearful-symmetry fearful-symmetry requested review from a team December 2, 2019 19:52
@fearful-symmetry fearful-symmetry requested a review from a team December 3, 2019 16:12
assert.Equal(t, event.Fields["message"], logString)
}

func setupTestClient(t *testing.T, logString string) (*pipelinemock.MockPipelineConnector, func()) {
Copy link

Choose a reason for hiding this comment

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

nit; the function name does not match the return type. Where do we create and publish the event?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, cleaned this up and adding some comments that hopefully clarify this.

@fearful-symmetry fearful-symmetry requested a review from a team December 3, 2019 21:59
@fearful-symmetry fearful-symmetry merged commit ea96903 into elastic:feature/dockerbeat Dec 4, 2019
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Add more integration tests and a mock framework
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants