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

[Ingest pipelines] Tests for pipeline debugging enhancement #75606

Merged

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Aug 20, 2020

This PR adds test coverage for the work implemented via #74964.

Screen Shot 2020-08-21 at 11 28 38 PM

Screen Shot 2020-08-21 at 11 50 00 AM

@alisonelizabeth alisonelizabeth added v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes v7.10.0 Feature:Ingest Node Pipelines Ingest node pipelines management labels Aug 20, 2020
@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

@alisonelizabeth alisonelizabeth changed the title [Ingest pipelines] [WIP] Component integration tests [Ingest pipelines] Tests for pipeline debugging enhancement Aug 24, 2020
@alisonelizabeth alisonelizabeth marked this pull request as ready for review August 24, 2020 13:20
@alisonelizabeth alisonelizabeth requested a review from a team as a code owner August 24, 2020 13:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@alisonelizabeth
Copy link
Contributor Author

cc @cuff-links

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

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

Great work @alisonelizabeth ! Very well written tests. I left a comment about mocking uuid, not sure if that would simplify things of make it more complex. I let you decide.

// Initialize mock services
uiMetricService.setup(usageCollectionPluginMock.createSetupContract());
// @ts-ignore
apiService.setup(mockHttpClient, uiMetricService);
Copy link
Contributor

Choose a reason for hiding this comment

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

It is strange to have this setup call and the one above inside the initHttpRequests as it is not related.
In other places we have a setupEnvironement() where we setup the services and call the initHttpRequests. Do you mind keeping it consistent?

<KibanaContextProvider services={appServices}>
<ProcessorsEditorContextProvider {...props}>
<TestPipelineActions />
<ProcessorsEditor /> <GlobalOnFailureProcessorsEditor />
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe the <GlobalOnFailureProcessorsEditor /> on the next line for readability?

// this is generated dynamically and not something we can stub.
// As a workaround, the value is added as a data attribute in the UI
// and we retrieve it to generate the mocked output.
const addProcessorTagtoMockOutput = (output: VerboseTestOutput) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess that another way would have been to mock the v4() method of the uuid package and return a sequential id. So if there are 5 processors, their id would be 0, 1, 2, 3, 4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I'm going to leave this as-is for now, but will consider refactoring it as I add more tests.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
ingestPipelines 705.7KB +257.0B 705.5KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Ingest Node Pipelines Ingest node pipelines management release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants