@@ -51,6 +51,7 @@ var QUEUE_WAIT = 10;
51
51
var pattern = process . argv [ 2 ] ;
52
52
var mockList = getMockList ( pattern ) ;
53
53
var isInQueue = ( process . argv [ 3 ] === '--queue' ) ;
54
+ var isCI = process . env . CIRCLECI ;
54
55
55
56
if ( mockList . length === 0 ) {
56
57
throw new Error ( 'No mocks found with pattern ' + pattern ) ;
@@ -60,7 +61,19 @@ if(mockList.length === 0) {
60
61
if ( ! pattern ) {
61
62
console . log ( 'Filtering out untestable mocks:' ) ;
62
63
mockList = mockList . filter ( untestableFilter ) ;
63
- console . log ( '\n' ) ;
64
+ }
65
+
66
+ // gl2d have limited image-test support
67
+ if ( pattern === 'gl2d_*' ) {
68
+
69
+ if ( ! isInQueue ) {
70
+ console . log ( 'WARN: Running gl2d image tests in batch may lead to unwanted results\n' ) ;
71
+ }
72
+
73
+ if ( isCI ) {
74
+ console . log ( 'Filtering out multiple-subplot gl2d mocks:' ) ;
75
+ mockList = mockList . filter ( untestableGL2DonCIfilter ) ;
76
+ }
64
77
}
65
78
66
79
// main
@@ -93,11 +106,30 @@ function untestableFilter(mockName) {
93
106
return cond ;
94
107
}
95
108
109
+ /* gl2d mocks that have multiple subplots
110
+ * can't be generated properly on CircleCI
111
+ * at the moment.
112
+ *
113
+ * For more info see:
114
+ * https://github.com/plotly/plotly.js/pull/980
115
+ *
116
+ */
117
+ function untestableGL2DonCIfilter ( mockName ) {
118
+ var cond = [
119
+ 'gl2d_multiple_subplots' ,
120
+ 'gl2d_simple_inset' ,
121
+ 'gl2d_stacked_coupled_subplots' ,
122
+ 'gl2d_stacked_subplots'
123
+ ] . indexOf ( mockName ) === - 1 ;
124
+
125
+ if ( ! cond ) console . log ( ' -' , mockName ) ;
126
+
127
+ return cond ;
128
+ }
129
+
96
130
function runInBatch ( mockList ) {
97
131
var running = 0 ;
98
132
99
- // remove mapbox mocks if circle ci
100
-
101
133
test ( 'testing mocks in batch' , function ( t ) {
102
134
t . plan ( mockList . length ) ;
103
135
0 commit comments