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

Testing framework for new pipeline #22139

Closed
timroes opened this issue Aug 17, 2018 · 0 comments · Fixed by #27015
Closed

Testing framework for new pipeline #22139

timroes opened this issue Aug 17, 2018 · 0 comments · Fixed by #27015
Labels
enhancement New value added to drive a business result Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@timroes
Copy link
Contributor

timroes commented Aug 17, 2018

We should build a proper testing framework for the new pipeline. There are mainly two sort of tests, that should be able to be executed easily (currently I think Jest would be the go to way):

  • Execute a pipeline and compare the returning data
  • Execute a pipeline and render the output and compare the screenshot

After discussing that, we would like the pipeline to actually execute against a running Elasticsearch, to basically test the pipeline execution and chart rendering on a complete vertical stack.

Using utility functions tests should be really easy to write with the new framework:

import { pipelineData, pipelineRender } from '../pipeline_utils';

describe('esaggs function', () => {
  pipelineData('esaggs aggs="[{ type: count }]"').toEqual([ 421 ]);
  pipelineData('esaggs').toFail('missing param');
});

describe('pie chart', () => {
  pipelineRender('staticDemoData | pie_chart').toMatchScreenshot();
});

That way we could add new tests (e.g. for incoming bugs) in a very quick way. It's also very easy to have a huge amount of tests for different combinations (which it e.g. isn't currently for functional tests, since they need to click through all editors).

That framework would also then allow us to test the chart rendering decoupled from the data fetching. If we have an issue that a chart couldn't draw it's axis if the labels got too long, we don't need to find an aggregation configuration in the editor to draw that chart, but rather use demo data to directly produce the data we need in the pipeline and just test the actual chart rendering. The same vice versa for issues purely in the data fetching part of the pipeline.

@timroes timroes added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) enhancement New value added to drive a business result Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) labels Aug 17, 2018
@timroes timroes added Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant