Skip to content

Commit be33648

Browse files
committed
circleci: ⚡ test-image-gl2d, reintroduce sorting of gl2d mocks
1 parent b99672b commit be33648

File tree

2 files changed

+35
-10
lines changed

2 files changed

+35
-10
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"test-export": "node tasks/test_export.js",
3939
"test-syntax": "node tasks/test_syntax.js && npm run find-strings -- --no-output",
4040
"test-bundle": "node tasks/test_bundle.js",
41-
"test": "npm run test-jasmine && npm run test-bundle && npm run test-image && npm run test-image-gl2d && npm run test-syntax && npm run lint",
41+
"test": "npm run test-jasmine -- --nowatch && npm run test-bundle && npm run test-image && npm run test-export && npm run test-syntax && npm run lint",
4242
"start-test_dashboard": "node devtools/test_dashboard/server.js",
4343
"start-image_viewer": "node devtools/image_viewer/server.js",
4444
"start": "npm run start-test_dashboard",

test/image/compare_pixels_test.js

+34-9
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,10 @@ argv._.forEach(function(pattern) {
7373
});
7474

7575
// To get rid of duplicates
76-
Array.prototype.unique = function() {
77-
return this.filter(function(value, index, self) {
78-
return self.indexOf(value) === index;
79-
});
80-
};
81-
allMockList = allMockList.unique();
76+
function unique(value, index, self) {
77+
return self.indexOf(value) === index;
78+
}
79+
allMockList = allMockList.filter(unique);
8280

8381
// filter out untestable mocks if no pattern is specified (ie. we're testing all mocks)
8482
// or if flag '--filter' is provided
@@ -88,6 +86,8 @@ if(allMock || filter) {
8886
console.log('\n');
8987
}
9088

89+
sortGl2dMockList(allMockList);
90+
9191
// main
9292
if(isInQueue) {
9393
runInQueue(allMockList);
@@ -99,9 +99,7 @@ else {
9999
/* Test cases:
100100
*
101101
* - font-wishlist
102-
* - all gl2d
103102
* - all mapbox
104-
* - gl3d_cone-*
105103
*
106104
* don't behave consistently from run-to-run and/or
107105
* machine-to-machine; skip over them for now.
@@ -110,7 +108,6 @@ else {
110108
function untestableFilter(mockName) {
111109
var cond = !(
112110
mockName === 'font-wishlist' ||
113-
// mockName.indexOf('gl2d_') !== -1 ||
114111
mockName.indexOf('mapbox_') !== -1
115112
);
116113

@@ -119,6 +116,34 @@ function untestableFilter(mockName) {
119116
return cond;
120117
}
121118

119+
/* gl2d pointcloud and other non-regl gl2d mock(s)
120+
* must be tested first on in order to work;
121+
* sort them here.
122+
*
123+
* gl-shader appears to conflict with regl.
124+
* We suspect that the lone gl context on CircleCI is
125+
* having issues with dealing with the two different
126+
* program binding algorithm.
127+
*
128+
* The problem will be solved by switching all our
129+
* WebGL-based trace types to regl.
130+
*
131+
* More info here:
132+
* https://github.com/plotly/plotly.js/pull/1037
133+
*/
134+
function sortGl2dMockList(mockList) {
135+
var mockNames = ['gl2d_pointcloud-basic', 'gl2d_heatmapgl'];
136+
var pos = 0;
137+
138+
mockNames.forEach(function(m) {
139+
var ind = mockList.indexOf(m);
140+
var tmp = mockList[pos];
141+
mockList[pos] = m;
142+
mockList[ind] = tmp;
143+
pos++;
144+
});
145+
}
146+
122147
function runInBatch(mockList) {
123148
var running = 0;
124149

0 commit comments

Comments
 (0)