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

Replace reference screenshots #17597

Merged

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Apr 6, 2018

pulls in same changes as #17594

@thomasneirynck thomasneirynck added WIP Work in progress Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Apr 6, 2018
replace screenshot

fix debug line

fix test-code/replace screenshots
@elasticmachine
Copy link
Contributor

💚 Build Succeeded


tagCloud = new TagCloud(domNode);
tagCloud.setData(baseTest.data);
tagCloud.setOptions(baseTest.options);

await fromNode(cb => tagCloud.once('renderComplete', cb));

const mismatchedPixels = await imageComparator.compareDOMContents(domNode.innerHTML, 512, 512, simpleloadPng, 0.50);
const mismatchedPixels = await imageComparator.compareDOMContents(domNode.innerHTML, 512, 512, simpleloadPng, 0.35);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tighten down more.

@@ -8,7 +8,7 @@ import basicdrawPng from './basicdraw.png';
import afterresizePng from './afterresize.png';
import afterparamChange from './afterparamchange.png';

const THRESHOLD = 0.65;
const THRESHOLD = 0.35;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tighten down

await tagcloudVisualization.render(dummyTableGroup, {
resize: false,
params: true,
aggs: true,
data: true,
uiState: false
});
const mismatchedPixels = await imageComparator.compareDOMContents(domNode.innerHTML, 512, 512, basicdrawPng, THRESHOLD);

const svgNode = domNode.querySelector('svg');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was a bug in the test-code. This PR (#15779) changed the internal DOM, and this unit test did not get updated accordingly. It didn't fail because comparison was too permissive, clouds have a lot of whitespace.

sourceImage.onload = async () => {
sourceContext2d.drawImage(sourceImage, 0, 0);
const mismatch = await this.compareImage(sourceCanvas, expectedImageSourcePng, threshold);
document.body.removeChild(sourceCanvas);
resolve(mismatch);
};
sourceImage.onerror = (e) => {
reject(e.message);
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sure tests actually throw when image cannot be loaded.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@thomasneirynck
Copy link
Contributor Author

cc @timroes

@thomasneirynck
Copy link
Contributor Author

jenkins, test this

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@thomasneirynck thomasneirynck merged commit e634aa3 into elastic:master Apr 9, 2018
@thomasneirynck thomasneirynck added v7.0.0 v6.3.0 chore and removed WIP Work in progress labels Apr 9, 2018
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Apr 9, 2018
pulls in TimR's changes (elastic#17594) to the hashing algorithm. This also replaces the reference screenshots to match the new rotations.
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

thomasneirynck added a commit that referenced this pull request Apr 10, 2018
Applies to Tagcloud. #17597 made them too strict, causing them to fail in CI.
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Apr 10, 2018
pulls in TimR's changes (elastic#17594) to the hashing algorithm. This also replaces the reference screenshots to match the new rotations.
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Apr 10, 2018
…ic#17626)

Applies to Tagcloud. elastic#17597 made them too strict, causing them to fail in CI.
thomasneirynck added a commit that referenced this pull request Apr 11, 2018
* Change hashing algo of tagcloud rotations (#17597)

pulls in TimR's changes (#17594) to the hashing algorithm. This also replaces the reference screenshots to match the new rotations.

* Revert screenshot comparison tests to old threshold parameters (#17626)

Applies to Tagcloud. #17597 made them too strict, causing them to fail in CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:Visualizations Generic visualization features (in case no more specific feature label is available) v6.3.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants