From 0ce8cd287e2bd5f44f6030bb2a68435c38cf2400 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Mon, 19 Aug 2024 21:47:16 -0400 Subject: [PATCH] revise flaky map image comparison --- test/image/compare_pixels_test.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/test/image/compare_pixels_test.js b/test/image/compare_pixels_test.js index e7b6295d457..ad47a502173 100644 --- a/test/image/compare_pixels_test.js +++ b/test/image/compare_pixels_test.js @@ -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); @@ -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([