-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Changes from 3 commits
13b5825
73c34e6
e64b05c
a3ac96d
84bcb63
9daf1b2
0c116dc
de73692
563b368
1e04e9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:'); | ||
mockList = mockList.filter(untestableGL2DonCIfilter); | ||
console.log('\n'); | ||
} | ||
} | ||
|
||
// main | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dfcreative did you ever get this mock working on CI? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... maybe a commit of yours never made it in #980 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @etpinard I suppose the 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You can try 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); | ||
|
||
|
There was a problem hiding this comment.
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 thepointcloud
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 thepointcloud
stuff would be tested, vs. nopointcloud
test on CI right now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would be great!