Skip to content

Commit a1b4872

Browse files
committed
run @gl jasmine specs in separate job
1 parent e964222 commit a1b4872

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
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

0 commit comments

Comments
 (0)