Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f304e6

Browse files
committed
sort pointcloud and heatmapgl mock
... in compare px test, so that they don't conflict with regl-based scattergl.
1 parent 69a033b commit 9f304e6

File tree

1 file changed

+23
-47
lines changed

1 file changed

+23
-47
lines changed

test/image/compare_pixels_test.js

Lines changed: 23 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ var QUEUE_WAIT = 10;
5151
var pattern = process.argv[2];
5252
var mockList = getMockList(pattern);
5353
var isInQueue = (process.argv[3] === '--queue');
54-
var isCI = process.env.CIRCLECI;
55-
5654

5755
if(mockList.length === 0) {
5856
throw new Error('No mocks found with pattern ' + pattern);
@@ -67,18 +65,12 @@ if(!pattern) {
6765

6866
// gl2d have limited image-test support
6967
if(pattern === 'gl2d_*') {
70-
7168
if(!isInQueue) {
7269
console.log('WARN: Running gl2d image tests in batch may lead to unwanted results\n');
7370
}
74-
75-
if(isCI) {
76-
console.log('Filtering out multiple-subplot gl2d mocks:');
77-
mockList = mockList
78-
.filter(untestableGL2DonCIfilter)
79-
.sort(sortForGL2DonCI);
80-
console.log('\n');
81-
}
71+
console.log('\nSorting gl2d mocks to avoid gl-shader conflicts');
72+
sortGl2dMockList(mockList);
73+
console.log('');
8274
}
8375

8476
// main
@@ -111,48 +103,32 @@ function untestableFilter(mockName) {
111103
return cond;
112104
}
113105

114-
/* gl2d mocks that have multiple subplots
115-
* can't be generated properly on CircleCI
116-
* at the moment.
117-
*
118-
* For more info see:
119-
* https://github.com/plotly/plotly.js/pull/980
106+
/* gl2d pointcloud and other non-regl gl2d mock(s)
107+
* must be tested first on in order to work;
108+
* sort them here.
120109
*
121-
*/
122-
function untestableGL2DonCIfilter(mockName) {
123-
var cond = [
124-
'gl2d_multiple_subplots',
125-
'gl2d_simple_inset',
126-
'gl2d_stacked_coupled_subplots',
127-
'gl2d_stacked_subplots'
128-
].indexOf(mockName) === -1;
129-
130-
if(!cond) console.log(' -', mockName);
131-
132-
return cond;
133-
}
134-
135-
/* gl2d pointcloud mock(s) must be tested first
136-
* on CircleCI in order to work; sort them here.
137-
*
138-
* Pointcloud relies on [email protected] whereas
139-
* other gl2d trace modules rely on [email protected],
140-
* we suspect that the lone gl context on CircleCI is
110+
* gl-shader appears to conflict with regl.
111+
* We suspect that the lone gl context on CircleCI is
141112
* having issues with dealing with the two different
142-
* gl-shader versions.
113+
* program binding algorithm.
114+
*
115+
* The problem will be solved by switching all our
116+
* WebGL-based trace types to regl.
143117
*
144118
* More info here:
145119
* https://github.com/plotly/plotly.js/pull/1037
146120
*/
147-
function sortForGL2DonCI(a, b) {
148-
var root = 'gl2d_pointcloud',
149-
ai = a.indexOf(root),
150-
bi = b.indexOf(root);
151-
152-
if(ai < bi) return 1;
153-
if(ai > bi) return -1;
154-
155-
return 0;
121+
function sortGl2dMockList(mockList) {
122+
var mockNames = ['gl2d_pointcloud-basic', 'gl2d_heatmapgl'];
123+
var pos = 0;
124+
125+
mockNames.forEach(function(m) {
126+
var ind = mockList.indexOf(m);
127+
var tmp = mockList[pos];
128+
mockList[pos] = m;
129+
mockList[ind] = tmp;
130+
pos++;
131+
});
156132
}
157133

158134
function runInBatch(mockList) {

0 commit comments

Comments
 (0)