Skip to content

Commit 894bbad

Browse files
committed
Merge pull request #443 from plotly/add-back-random-image-tests
Un-skip troublesome image tests
2 parents 440f815 + 7e16d0f commit 894bbad

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

test/image/compare_pixels_test.js

+13-17
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ var request = require('request');
99
var test = require('tape');
1010
var gm = require('gm');
1111

12+
var TOLERANCE = 1e-6; // pixel comparison tolerance
13+
var BASE_TIMEOUT = 500; // base timeout time
14+
var BATCH_SIZE = 5; // size of each test 'batch'
15+
1216
var touch = function(fileName) {
1317
fs.closeSync(fs.openSync(fileName, 'w'));
1418
};
@@ -33,31 +37,23 @@ function runAll() {
3337

3438
var allMocks = fs.readdirSync(constants.pathToTestImageMocks);
3539

36-
/*
37-
* Some test cases exhibit run-to-run randomness;
38-
* skip over these few test cases for now.
40+
/* Test cases:
41+
*
42+
* - font-wishlist
43+
* - all gl2d
3944
*
40-
* More info:
41-
* https://github.com/plotly/plotly.js/issues/62
45+
* don't behave consistently from run-to-run and/or
46+
* machine-to-machine; skip over them.
4247
*
43-
* 41 test cases are removed:
44-
* - font-wishlist (1 test case)
45-
* - all gl2d (38)
46-
* - gl3d_bunny-hull (1)
47-
* - polar_scatter (1)
4848
*/
4949
var mocks = allMocks.filter(function(mock) {
5050
return !(
5151
mock === 'font-wishlist.json' ||
52-
mock.indexOf('gl2d') !== -1 ||
53-
mock === 'gl3d_bunny-hull.json' ||
54-
mock === 'polar_scatter.json'
52+
mock.indexOf('gl2d') !== -1
5553
);
5654
});
5755

58-
var BASE_TIMEOUT = 500, // base timeout time
59-
BATCH_SIZE = 5, // size of each test 'batch'
60-
cnt = 0;
56+
var cnt = 0;
6157

6258
function testFunction() {
6359
testMock(mocks[cnt++], t);
@@ -98,7 +94,7 @@ function testMock(fileName, t) {
9894
var options = {
9995
file: diffPath,
10096
highlightColor: 'purple',
101-
tolerance: 1e-6
97+
tolerance: TOLERANCE
10298
};
10399

104100
/*

0 commit comments

Comments
 (0)