Skip to content

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

Merged
fearful-symmetry merged 8 commits intoelastic:feature/dockerbeatfrom
fearful-symmetry:dockerbeat-testing-additional
Dec 4, 2019
Merged

[Docker Log driver] Expand testing, add mocking tooling#14828
fearful-symmetry merged 8 commits intoelastic:feature/dockerbeatfrom
fearful-symmetry:dockerbeat-testing-additional

Conversation

@fearful-symmetry
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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