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

Add mechanism for dashboard snapshots #15463

Merged
merged 13 commits into from
Dec 13, 2017

Conversation

stacey-gammon
Copy link
Contributor

@stacey-gammon stacey-gammon commented Dec 6, 2017

Resolves #15458

If the test fails due to an expected change, you simply have to run the tests locally with the command line flag --updateBaselines which will generate a new screenshot to be uploaded with your PR (similar to -u with the jest snapshots).

@stacey-gammon stacey-gammon added Feature:Dashboard Dashboard related features :Sharing test labels Dec 6, 2017
@stacey-gammon
Copy link
Contributor Author

Failing on the rendering issues. waitForAllSharedItemsToFinishRendering is not working correctly, though it may be because there are currently issues with the render-counter.

@stacey-gammon stacey-gammon force-pushed the test/dashboard-snapshots branch 2 times, most recently from e1dd3ba to 55cd94a Compare December 8, 2017 18:20
@stacey-gammon
Copy link
Contributor Author

I think these comparisons are the closest we'll get with OS and browser differences:

area_chart 8
area_chart-resized 2
area_chart-resized 3

This equates to a difference percentage of 0.009916455696202532 so I'm going to use a threshold of .05 for the area test. We will probably want to set each threshold for each test manually.

The other option is to explore going back to os/browser difference specific snapshots.

@stacey-gammon
Copy link
Contributor Author

Well, looks like the render counter stuff is probably not working properly as the screenshot came out blank. I'll have to investigate some more before it's ready for review again. :(

@stacey-gammon
Copy link
Contributor Author

What do you know!! It's not a mistake, it actually caught a legit bug! Woooooooot.

@stacey-gammon stacey-gammon force-pushed the test/dashboard-snapshots branch from 12d916a to 7b13cde Compare December 13, 2017 14:29
@stacey-gammon
Copy link
Contributor Author

And back to passing now that the expanded panel bug is fixed. Ready for review!

@@ -28,6 +29,12 @@ if (cmd.verbose) logLevel = 'verbose';
const log = createToolingLog(logLevel);
log.pipe(process.stdout);

if (cmd.updateBaselines) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Determining whether this test-run should update the snapshots via an environment variable seems rather hacky, is there a way to pass this to the tests via the config/configOverrides in the createFunctionalTestRunner; or a way to run dedicated tests within the apps perhaps by hi-jacking the grep extension in mocha?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, I meant to revisit that. Found an alternative solution without using environment variables.

Copy link
Contributor

@kobelb kobelb left a comment

Choose a reason for hiding this comment

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

LGTM

@stacey-gammon
Copy link
Contributor Author

Fingers crossed this doesn't create flakiness and I tested it enough! 🤞

@stacey-gammon stacey-gammon merged commit 56b9a7c into elastic:master Dec 13, 2017
stacey-gammon added a commit to stacey-gammon/kibana that referenced this pull request Dec 13, 2017
* Add mechanism for dashboard snapshots

* Adjust wait for render function since it needs to be 2, not gt 0.

Should be obsolete when the new render stuff is complete.

* resize images using new library so comparisons work across different screen resolutions

* use jimp comparison and see if expanding to expanded panel mode helps when comparing across browser/os

* Try to ensure window size

* Experiment with a smaller window, see if screenshot dimensions change

Update screenshot for new window dimensions

* Try cover + quality, see what the diffs look like.

* Stop trying to get TSVB to pass, try area charts

There is a timezone bug with tsvb:
elastic#15501

* gah, cover didn't work, check resize

* bump render counter to 6, as it should be.

As it turns out, the visualization was not done re-rendering to
maximized mode

* Bump threshold for comparison

* reduce down to a single test run

* Don't use an environment variable to detect updateBaselines cmd line flag
stacey-gammon added a commit that referenced this pull request Dec 13, 2017
* Add mechanism for dashboard snapshots

* Adjust wait for render function since it needs to be 2, not gt 0.

Should be obsolete when the new render stuff is complete.

* resize images using new library so comparisons work across different screen resolutions

* use jimp comparison and see if expanding to expanded panel mode helps when comparing across browser/os

* Try to ensure window size

* Experiment with a smaller window, see if screenshot dimensions change

Update screenshot for new window dimensions

* Try cover + quality, see what the diffs look like.

* Stop trying to get TSVB to pass, try area charts

There is a timezone bug with tsvb:
#15501

* gah, cover didn't work, check resize

* bump render counter to 6, as it should be.

As it turns out, the visualization was not done re-rendering to
maximized mode

* Bump threshold for comparison

* reduce down to a single test run

* Don't use an environment variable to detect updateBaselines cmd line flag
nyurik pushed a commit to nyurik/kibana that referenced this pull request Dec 15, 2017
* Add mechanism for dashboard snapshots

* Adjust wait for render function since it needs to be 2, not gt 0.

Should be obsolete when the new render stuff is complete.

* resize images using new library so comparisons work across different screen resolutions

* use jimp comparison and see if expanding to expanded panel mode helps when comparing across browser/os

* Try to ensure window size

* Experiment with a smaller window, see if screenshot dimensions change

Update screenshot for new window dimensions

* Try cover + quality, see what the diffs look like.

* Stop trying to get TSVB to pass, try area charts

There is a timezone bug with tsvb:
elastic#15501

* gah, cover didn't work, check resize

* bump render counter to 6, as it should be.

As it turns out, the visualization was not done re-rendering to
maximized mode

* Bump threshold for comparison

* reduce down to a single test run

* Don't use an environment variable to detect updateBaselines cmd line flag
@stacey-gammon stacey-gammon deleted the test/dashboard-snapshots branch September 21, 2018 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Dashboard Dashboard related features test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants