Skip to content

gl2d image tests (finally) #1037

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 10 commits into from
Oct 19, 2016
Merged
Show file tree
Hide file tree
Changes from 9 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
1 change: 1 addition & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies:
test:
override:
- npm run test-image
- npm run test-image-gl2d
- npm run test-export
- npm run citest-jasmine
- npm run test-bundle
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"test-jasmine": "karma start test/jasmine/karma.conf.js",
"citest-jasmine": "karma start test/jasmine/karma.ciconf.js",
"test-image": "node tasks/test_image.js",
"test-image-gl2d": "node tasks/test_image.js gl2d_* --queue",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run npm run test-image-gl2d to run gl2d image tests locally.

"test-export": "node tasks/test_export.js",
"test-syntax": "node tasks/test_syntax.js",
"test-bundle": "node tasks/test_bundle.js",
Expand Down
Binary file modified test/image/baselines/gl2d_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed test/image/baselines/gl2d_22.png
Binary file not shown.
Binary file removed test/image/baselines/gl2d_24.png
Binary file not shown.
Binary file removed test/image/baselines/gl2d_28.png
Binary file not shown.
Binary file removed test/image/baselines/gl2d_30.png
Binary file not shown.
Binary file removed test/image/baselines/gl2d_32.png
Binary file not shown.
Binary file modified test/image/baselines/gl2d_axes_booleans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_axes_labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_axes_lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_axes_range_manual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_axes_range_mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_axes_range_type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed test/image/baselines/gl2d_basic_error_bar.png
Binary file not shown.
Binary file removed test/image/baselines/gl2d_bubble_markersize0.png
Binary file not shown.
Binary file not shown.
Binary file added test/image/baselines/gl2d_connect_gaps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_date_axes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file removed test/image/baselines/gl2d_error_bar_horizontal.png
Binary file not shown.
Binary file removed test/image/baselines/gl2d_error_bar_style.png
Binary file not shown.
Binary file added test/image/baselines/gl2d_error_bars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_fonts.png
Binary file removed test/image/baselines/gl2d_global_font.png
Diff not rendered.
Binary file removed test/image/baselines/gl2d_legend_inside.png
Diff not rendered.
Binary file removed test/image/baselines/gl2d_legend_labels.png
Diff not rendered.
Binary file removed test/image/baselines/gl2d_legend_outside.png
Diff not rendered.
Binary file removed test/image/baselines/gl2d_legend_style.png
Diff not rendered.
Binary file removed test/image/baselines/gl2d_line_style.png
Diff not rendered.
Binary file modified test/image/baselines/gl2d_multiple_subplots.png
Binary file added test/image/baselines/gl2d_pointcloud-basic.png
Binary file modified test/image/baselines/gl2d_scatter-colorscale-colorbar.png
Binary file modified test/image/baselines/gl2d_scatter-marker-line-colorscales.png
Binary file removed test/image/baselines/gl2d_show_legend.png
Diff not rendered.
Binary file modified test/image/baselines/gl2d_simple_inset.png
Binary file modified test/image/baselines/gl2d_size_margins.png
Binary file modified test/image/baselines/gl2d_stacked_coupled_subplots.png
Binary file modified test/image/baselines/gl2d_stacked_subplots.png
50 changes: 46 additions & 4 deletions test/image/compare_pixels_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,31 @@ var QUEUE_WAIT = 10;
var pattern = process.argv[2];
var mockList = getMockList(pattern);
var isInQueue = (process.argv[3] === '--queue');
var isCI = process.env.CIRCLECI;

if(mockList.length === 0) {
throw new Error('No mocks found with pattern ' + pattern);
}

// filter out untestable mocks if no pattern is specified
if(!pattern) {
console.log('Filtering out untestable mocks\n');
console.log('Filtering out untestable mocks:');
mockList = mockList.filter(untestableFilter);
console.log('\n');
}

// gl2d have limited image-test support
if(pattern === 'gl2d_*') {

if(!isInQueue) {
console.log('WARN: Running gl2d image tests in batch may lead to unwanted results\n');
}

if(isCI) {
console.log('Filtering out multiple-subplot gl2d mocks:');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be a slightly more general log entry b/c the pointcloud test is in this set too -- or we might want to alter the pointcloud test such that it doesn't test the blending effect (I can do it in a separate small PR) but even then, at least most of the pointcloud stuff would be tested, vs. no pointcloud test on CI right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to alter the pointcloud test such that it doesn't test the blending effect (I can do it in a separate small PR)

that would be great!

mockList = mockList.filter(untestableGL2DonCIfilter);
console.log('\n');
}
}

// main
Expand All @@ -81,18 +97,44 @@ else {
*
*/
function untestableFilter(mockName) {
return !(
var cond = !(
mockName === 'font-wishlist' ||
mockName.indexOf('gl2d_') !== -1 ||
mockName.indexOf('mapbox_') !== -1
);

if(!cond) console.log(' -', mockName);

return cond;
}

/* gl2d mocks that have multiple subplots
* can't be generated properly on CircleCI
* at the moment.
*
* For more info see:
* https://github.com/plotly/plotly.js/pull/980
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice doc reference in the code!

*
*/
function untestableGL2DonCIfilter(mockName) {
var cond = [
'gl2d_multiple_subplots',
'gl2d_simple_inset',
'gl2d_stacked_coupled_subplots',
'gl2d_stacked_subplots',

// not sure why this one still fails on CircleCI
'gl2d_pointcloud-basic'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dfcreative did you ever get this mock working on CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... maybe a commit of yours never made it in #980

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etpinard I suppose the pointcloud CI testing failure is for the reason discussed from this comment #980 (comment)

Any way I can simulate the workings of CI locally, or read about its constituents? I could try and see what's going on with the pointcloud test blending. Although it should not hold back this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way I can simulate the workings of CI locally

You can try npm run test-image -- gl2d_pointcloud-basic but that results in a passing test on my machine. Not sure what differences on CI may lead to this issue.

Referencing #241

].indexOf(mockName) === -1;

if(!cond) console.log(' -', mockName);

return cond;
}

function runInBatch(mockList) {
var running = 0;

// remove mapbox mocks if circle ci

test('testing mocks in batch', function(t) {
t.plan(mockList.length);

Expand Down
4 changes: 3 additions & 1 deletion test/image/export_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ var test = require('tape');
var FORMATS = ['svg', 'pdf', 'eps'];

// non-exhaustive list of mocks to test
var DEFAULT_LIST = ['0', 'geo_first', 'gl3d_z-range', 'text_export', 'layout_image'];
var DEFAULT_LIST = [
'0', 'geo_first', 'gl3d_z-range', 'text_export', 'layout_image', 'gl2d_12'
];

// return dimensions [in px]
var WIDTH = 700;
Expand Down
Loading