Skip to content

Commit 3eccac0

Browse files
authored
Merge pull request #7121 from plotly/reduce-falky-maps
revise flaky map image comparison
2 parents 64a8442 + 0ce8cd2 commit 3eccac0

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

test/image/compare_pixels_test.js

+16-12
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,29 @@ for(var i = 0; i < allMockList.length; i++) {
114114
// See https://github.com/plotly/plotly.js/issues/7075
115115
if(isMapbox) continue;
116116

117-
var isOtherFlaky = [
118-
// list flaky mocks other than mapbox:
117+
var flakyMap = [
118+
// more flaky
119119
'map_density0-legend',
120120
'map_osm-style',
121121
'map_predefined-styles1',
122122
'map_predefined-styles2',
123+
124+
'mapbox_angles',
125+
'mapbox_layers',
126+
'mapbox_custom-style',
127+
'mapbox_geojson-attributes'
128+
].indexOf(mockName) !== -1;
129+
130+
var otherFlaky = [
131+
// list flaky mocks other than maps:
123132
'gl3d_bunny-hull'
124133
].indexOf(mockName) !== -1;
125134

135+
var threshold =
136+
flakyMap ? 1 :
137+
otherFlaky ? 0.15 :
138+
0;
139+
126140
if(mathjax3) mockName = 'mathjax3___' + mockName;
127141

128142
var imagePaths = getImagePaths(mockName);
@@ -164,16 +178,6 @@ for(var i = 0; i < allMockList.length; i++) {
164178
height: height
165179
});
166180

167-
var shouldBePixelPerfect = !(isMapbox || isOtherFlaky);
168-
169-
var threshold = shouldBePixelPerfect ? 0 : [
170-
// more flaky
171-
'mapbox_angles',
172-
'mapbox_layers',
173-
'mapbox_custom-style',
174-
'mapbox_geojson-attributes'
175-
].indexOf(mockName) !== -1 ? 1 : 0.15;
176-
177181
if(virtualWebgl) {
178182
threshold = Math.max(0.4, threshold);
179183
if([

0 commit comments

Comments
 (0)