Skip to content

Un-skip troublesome image tests #443

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 2 commits into from
Apr 19, 2016
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
30 changes: 13 additions & 17 deletions test/image/compare_pixels_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ var request = require('request');
var test = require('tape');
var gm = require('gm');

var TOLERANCE = 1e-6; // pixel comparison tolerance
var BASE_TIMEOUT = 500; // base timeout time
var BATCH_SIZE = 5; // size of each test 'batch'

var touch = function(fileName) {
fs.closeSync(fs.openSync(fileName, 'w'));
};
Expand All @@ -33,31 +37,23 @@ function runAll() {

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

/*
* Some test cases exhibit run-to-run randomness;
* skip over these few test cases for now.
/* Test cases:
*
* - font-wishlist
* - all gl2d
*
* More info:
* https://github.com/plotly/plotly.js/issues/62
* don't behave consistently from run-to-run and/or
* machine-to-machine; skip over them.
*
* 41 test cases are removed:
* - font-wishlist (1 test case)
* - all gl2d (38)
* - gl3d_bunny-hull (1)
* - polar_scatter (1)
*/
var mocks = allMocks.filter(function(mock) {
return !(
mock === 'font-wishlist.json' ||
mock.indexOf('gl2d') !== -1 ||
mock === 'gl3d_bunny-hull.json' ||
mock === 'polar_scatter.json'
mock.indexOf('gl2d') !== -1
);
});

var BASE_TIMEOUT = 500, // base timeout time
BATCH_SIZE = 5, // size of each test 'batch'
cnt = 0;
var cnt = 0;

function testFunction() {
testMock(mocks[cnt++], t);
Expand Down Expand Up @@ -98,7 +94,7 @@ function testMock(fileName, t) {
var options = {
file: diffPath,
highlightColor: 'purple',
tolerance: 1e-6
tolerance: TOLERANCE
};

/*
Expand Down