Skip to content

revise flaky map image comparison #7121

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

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions test/image/compare_pixels_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,29 @@ for(var i = 0; i < allMockList.length; i++) {
// See https://github.com/plotly/plotly.js/issues/7075
if(isMapbox) continue;

var isOtherFlaky = [
// list flaky mocks other than mapbox:
var flakyMap = [
// more flaky
'map_density0-legend',
'map_osm-style',
'map_predefined-styles1',
'map_predefined-styles2',

'mapbox_angles',
'mapbox_layers',
'mapbox_custom-style',
'mapbox_geojson-attributes'
].indexOf(mockName) !== -1;

var otherFlaky = [
// list flaky mocks other than maps:
'gl3d_bunny-hull'
].indexOf(mockName) !== -1;

var threshold =
flakyMap ? 1 :
otherFlaky ? 0.15 :
0;

if(mathjax3) mockName = 'mathjax3___' + mockName;

var imagePaths = getImagePaths(mockName);
Expand Down Expand Up @@ -164,16 +178,6 @@ for(var i = 0; i < allMockList.length; i++) {
height: height
});

var shouldBePixelPerfect = !(isMapbox || isOtherFlaky);

var threshold = shouldBePixelPerfect ? 0 : [
// more flaky
'mapbox_angles',
'mapbox_layers',
'mapbox_custom-style',
'mapbox_geojson-attributes'
].indexOf(mockName) !== -1 ? 1 : 0.15;

if(virtualWebgl) {
threshold = Math.max(0.4, threshold);
if([
Expand Down