Skip to content

Commit f459723

Browse files
authored
Merge pull request #2328 from plotly/ci-improvements
Some CI improvements
2 parents b369dd6 + a41cc6b commit f459723

13 files changed

+67
-32
lines changed

.circleci/config.yml

+21-1
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,26 @@ jobs:
5858
command: |
5959
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
6060
- run:
61-
name: Run jasmine tests
61+
name: Run jasmine tests (batch 1)
6262
command: ./.circleci/test.sh jasmine
6363

64+
test-jasmine2:
65+
docker:
66+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
67+
- image: circleci/node:8.9.4-browsers
68+
working_directory: ~/plotly.js
69+
steps:
70+
- checkout
71+
- attach_workspace:
72+
at: ~/plotly.js
73+
- run:
74+
name: Set timezone to Alaska time (arbitrary timezone to test date logic)
75+
command: |
76+
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
77+
- run:
78+
name: Run jasmine tests (batch 2)
79+
command: ./.circleci/test.sh jasmine2
80+
6481
test-image:
6582
docker:
6683
- image: plotly/testbed:latest
@@ -100,6 +117,9 @@ workflows:
100117
- test-jasmine:
101118
requires:
102119
- build
120+
- test-jasmine2:
121+
requires:
122+
- build
103123
- test-image:
104124
requires:
105125
- build

.circleci/test.sh

+9-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ EXIT_STATE=0
99
case $1 in
1010

1111
jasmine)
12-
npm run test-jasmine || EXIT_STATE=$?
13-
npm run test-bundle || EXIT_STATE=$?
12+
npm run test-jasmine -- --skip-tags=gl,noCI || EXIT_STATE=$?
13+
exit $EXIT_STATE
14+
;;
15+
16+
jasmine2)
17+
npm run test-jasmine -- --tags=gl --skip-tags=noCI || EXIT_STATE=$?
18+
npm run test-bundle || EXIT_STATE=$?
1419
exit $EXIT_STATE
1520
;;
1621

@@ -22,8 +27,8 @@ case $1 in
2227
;;
2328

2429
syntax)
25-
npm run lint || EXIT_STATE=$?
26-
npm run test-syntax || EXIT_STATE=$?
30+
npm run lint || EXIT_STATE=$?
31+
npm run test-syntax || EXIT_STATE=$?
2732
exit $EXIT_STATE
2833
;;
2934

test/jasmine/karma.conf.js

+14-4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ if(argv.info) {
4343
' No need to add the `_test.js` suffix, we expand them correctly here.',
4444
' - `--bundleTest` set the bundle test suite `test/jasmine/bundle_tests/ to be run.',
4545
' Note that only one bundle test can be run at a time.',
46+
' - Use `--tags` to specify which `@` tags to test (if any) e.g `npm run test-jasmine -- --tags=gl`',
47+
' will run only gl tests.',
48+
' - Use `--skip-tags` to specify which `@` tags to skip (if any) e.g `npm run test-jasmine -- --skip-tags=gl`',
49+
' will skip all gl tests.',
4650
'',
4751
'Other options:',
4852
' - `--info`: show this info message',
@@ -101,9 +105,7 @@ var pathToJQuery = path.join(__dirname, 'assets', 'jquery-1.8.3.min.js');
101105
var pathToIE9mock = path.join(__dirname, 'assets', 'ie9_mock.js');
102106
var pathToCustomMatchers = path.join(__dirname, 'assets', 'custom_matchers.js');
103107

104-
105108
function func(config) {
106-
107109
// level of logging
108110
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
109111
//
@@ -202,9 +204,17 @@ func.defaultConfig = {
202204
debug: true
203205
},
204206

205-
// unfortunately a few tests don't behave well on CI
206-
// using `karma-jasmine-spec-tags`
207+
// Options for `karma-jasmine-spec-tags`
208+
// see https://www.npmjs.com/package/karma-jasmine-spec-tags
209+
//
210+
// A few tests don't behave well on CI
207211
// add @noCI to the spec description to skip a spec on CI
212+
//
213+
// Label tests that require a WebGL-context by @gl so that
214+
// they can be skipped using:
215+
// - $ npm run test-jasmine -- --skip-tags=gl
216+
// or run is isolation easily using:
217+
// - $ npm run test-jasmine -- --tags=gl
208218
client: {
209219
tagPrefix: '@',
210220
skipTags: isCI ? 'noCI' : null

test/jasmine/tests/geo_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ describe('Test geo interactions', function() {
10721072
.then(done);
10731073
});
10741074

1075-
it('@noCI should clear hover label when cursor slips off subplot', function(done) {
1075+
it('should clear hover label when cursor slips off subplot', function(done) {
10761076
var gd = createGraphDiv();
10771077
var fig = Lib.extendDeep({}, require('@mocks/geo_orthographic.json'));
10781078

test/jasmine/tests/gl2d_click_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var mock4 = {
6464
layout: {}
6565
};
6666

67-
describe('Test hover and click interactions', function() {
67+
describe('@gl Test hover and click interactions', function() {
6868
var gd;
6969

7070
function makeHoverFn(gd, x, y) {
@@ -532,7 +532,7 @@ describe('Test hover and click interactions', function() {
532532
});
533533
});
534534

535-
describe('@noCI Test gl2d lasso/select:', function() {
535+
describe('@noCI @gl Test gl2d lasso/select:', function() {
536536
var mockFancy = require('@mocks/gl2d_14.json');
537537
var mockFast = Lib.extendDeep({}, mockFancy, {
538538
data: [{mode: 'markers'}],

test/jasmine/tests/gl2d_date_axis_render_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var Plotly = require('@lib');
33
var createGraphDiv = require('../assets/create_graph_div');
44
var destroyGraphDiv = require('../assets/destroy_graph_div');
55

6-
describe('date axis', function() {
6+
describe('@gl date axis', function() {
77

88
var gd;
99

test/jasmine/tests/gl2d_plot_interact_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function countCanvases() {
2020
return d3.selectAll('canvas').size();
2121
}
2222

23-
describe('Test removal of gl contexts', function() {
23+
describe('@gl Test removal of gl contexts', function() {
2424
var gd;
2525

2626
beforeEach(function() {
@@ -87,7 +87,7 @@ describe('Test removal of gl contexts', function() {
8787
});
8888
});
8989

90-
describe('Test gl plot side effects', function() {
90+
describe('@gl Test gl plot side effects', function() {
9191
var gd;
9292

9393
beforeEach(function() {
@@ -207,7 +207,7 @@ describe('Test gl plot side effects', function() {
207207
});
208208
});
209209

210-
describe('Test gl2d plots', function() {
210+
describe('@gl Test gl2d plots', function() {
211211
var gd;
212212

213213
var mock = require('@mocks/gl2d_10.json');

test/jasmine/tests/gl2d_pointcloud_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function makePlot(gd, mock, done) {
144144
.then(done);
145145
}
146146

147-
describe('contourgl plots', function() {
147+
describe('@gl pointcloud traces', function() {
148148

149149
var gd;
150150

test/jasmine/tests/gl2d_scatterplot_contour_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function makePlot(gd, mock, done) {
167167
.then(done);
168168
}
169169

170-
describe('contourgl plots', function() {
170+
describe('@gl contourgl plots', function() {
171171

172172
var gd;
173173

test/jasmine/tests/gl3d_plot_interact_test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function countCanvases() {
2020
return d3.selectAll('canvas').size();
2121
}
2222

23-
describe('Test gl3d plots', function() {
23+
describe('@gl Test gl3d plots', function() {
2424
var gd, ptData;
2525

2626
var mock = require('@mocks/gl3d_marker-arrays.json');
@@ -422,7 +422,7 @@ describe('Test gl3d plots', function() {
422422

423423
});
424424

425-
describe('Test gl3d modebar handlers', function() {
425+
describe('@gl Test gl3d modebar handlers', function() {
426426
var gd, modeBar;
427427

428428
function assertScenes(cont, attr, val) {
@@ -650,7 +650,7 @@ describe('Test gl3d modebar handlers', function() {
650650
});
651651
});
652652

653-
describe('Test gl3d drag and wheel interactions', function() {
653+
describe('@gl Test gl3d drag and wheel interactions', function() {
654654
var gd, relayoutCallback;
655655

656656
function scroll(target) {
@@ -768,7 +768,7 @@ describe('Test gl3d drag and wheel interactions', function() {
768768
});
769769
});
770770

771-
describe('Test gl3d relayout calls', function() {
771+
describe('@gl Test gl3d relayout calls', function() {
772772
var gd;
773773

774774
beforeEach(function() {
@@ -834,7 +834,7 @@ describe('Test gl3d relayout calls', function() {
834834
});
835835
});
836836

837-
describe('Test gl3d annotations', function() {
837+
describe('@gl Test gl3d annotations', function() {
838838
var gd;
839839

840840
beforeEach(function() {
@@ -1212,7 +1212,7 @@ describe('Test gl3d annotations', function() {
12121212
});
12131213
});
12141214

1215-
describe('Test removal of gl contexts', function() {
1215+
describe('@gl Test removal of gl contexts', function() {
12161216
var gd;
12171217

12181218
beforeEach(function() {

test/jasmine/tests/gl_plot_interact_basic_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function testEvents(plot) {
5555
});
5656
}
5757

58-
describe('gl3d plots', function() {
58+
describe('@gl gl3d plots', function() {
5959

6060
var gd;
6161

test/jasmine/tests/parcoords_test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ describe('parcoords initialization tests', function() {
243243
});
244244
});
245245

246-
describe('@noCI parcoords', function() {
246+
describe('@gl parcoords', function() {
247247

248248
beforeAll(function() {
249249
mock.data[0].dimensions.forEach(function(d) {
@@ -405,7 +405,7 @@ describe('@noCI parcoords', function() {
405405
});
406406
});
407407

408-
it('Works with 60 dimensions', function(done) {
408+
it('@noCI Works with 60 dimensions', function(done) {
409409

410410
var mockCopy = Lib.extendDeep({}, mock1);
411411
var newDimension, i, j;
@@ -435,7 +435,7 @@ describe('@noCI parcoords', function() {
435435
});
436436
});
437437

438-
it('Truncates 60+ dimensions to 60', function(done) {
438+
it('@noCI Truncates 60+ dimensions to 60', function(done) {
439439

440440
var mockCopy = Lib.extendDeep({}, mock1);
441441
var newDimension, i, j;
@@ -463,7 +463,7 @@ describe('@noCI parcoords', function() {
463463
});
464464
});
465465

466-
it('Truncates dimension values to the shortest array, retaining only 3 lines', function(done) {
466+
it('@noCI Truncates dimension values to the shortest array, retaining only 3 lines', function(done) {
467467

468468
var mockCopy = Lib.extendDeep({}, mock1);
469469
var newDimension, i, j;

test/jasmine/tests/polar_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ describe('Test polar interactions:', function() {
739739
.then(done);
740740
});
741741

742-
it('@noCI should response to drag interactions on plot area', function(done) {
742+
it('should response to drag interactions on plot area', function(done) {
743743
var fig = Lib.extendDeep({}, require('@mocks/polar_scatter.json'));
744744

745745
// to avoid dragging on hover labels
@@ -830,7 +830,7 @@ describe('Test polar interactions:', function() {
830830
.then(done);
831831
});
832832

833-
it('@noCI should response to drag interactions on radial drag area', function(done) {
833+
it('should response to drag interactions on radial drag area', function(done) {
834834
var fig = Lib.extendDeep({}, require('@mocks/polar_scatter.json'));
835835

836836
// to avoid dragging on hover labels
@@ -914,7 +914,7 @@ describe('Test polar interactions:', function() {
914914
.then(done);
915915
});
916916

917-
it('@noCI should response to drag interactions on angular drag area', function(done) {
917+
it('should response to drag interactions on angular drag area', function(done) {
918918
var fig = Lib.extendDeep({}, require('@mocks/polar_scatter.json'));
919919

920920
// to avoid dragging on hover labels

0 commit comments

Comments
 (0)