Skip to content

Commit 10dd54a

Browse files
authored
Merge pull request #1455 from plotly/circleci-14.04-parallel
CircleCI with Ubuntu 14.04, 2x parallelism and WebGL jasmine tests
2 parents 20a47fd + 33ae963 commit 10dd54a

19 files changed

+117
-150
lines changed

circle.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
general:
22
artifacts:
3-
- "build/test_images/"
4-
- "build/test_images_diff/"
3+
- build/test_images/
4+
- build/test_images_diff/
55

66
machine:
77
node:
@@ -12,21 +12,16 @@ machine:
1212
- docker
1313

1414
dependencies:
15-
pre:
16-
- eval $(node tasks/docker.js pull)
17-
post:
18-
- eval $(node tasks/docker.js run)
19-
- npm run cibuild
15+
override:
16+
- npm install && npm dedupe && npm prune && npm install
17+
- npm ls || true
18+
- npm run docker -- pull
2019
- npm run pretest
21-
- eval $(node tasks/docker.js setup)
22-
- npm prune && npm ls
20+
- npm run docker -- run
21+
- npm run cibuild
22+
- npm run docker -- setup
2323

2424
test:
2525
override:
26-
- npm run test-image
27-
- npm run test-image-gl2d
28-
- npm run test-export
29-
- npm run citest-jasmine
30-
- npm run test-bundle
31-
- npm run test-syntax
32-
- eslint .
26+
- ./tasks/ci_test.sh:
27+
parallel: true

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
"build": "npm run preprocess && npm run bundle && npm run header && npm run stats",
2929
"cibuild": "npm run preprocess && node tasks/cibundle.js",
3030
"watch": "node tasks/watch.js",
31-
"lint": "eslint --version && eslint . || true",
32-
"lint-fix": "eslint . --fix",
31+
"lint": "eslint --version && eslint .",
32+
"lint-fix": "eslint . --fix || true",
3333
"docker": "node tasks/docker.js",
3434
"pretest": "node tasks/pretest.js",
3535
"test-jasmine": "karma start test/jasmine/karma.conf.js",
36-
"citest-jasmine": "karma start test/jasmine/karma.ciconf.js",
36+
"citest-jasmine": "CIRCLECI=1 karma start test/jasmine/karma.conf.js",
3737
"test-image": "node tasks/test_image.js",
3838
"test-image-gl2d": "node tasks/test_image.js gl2d_* --queue",
3939
"test-export": "node tasks/test_export.js",
@@ -119,6 +119,9 @@
119119
"karma-coverage": "^1.0.0",
120120
"karma-firefox-launcher": "^1.0.0",
121121
"karma-jasmine": "^1.1.0",
122+
"karma-jasmine-spec-tags": "^1.0.1",
123+
"karma-spec-reporter": "0.0.30",
124+
"karma-verbose-reporter": "0.0.6",
122125
"madge": "^1.6.0",
123126
"node-sass": "^4.5.0",
124127
"npm-link-check": "^1.2.0",
@@ -128,7 +131,7 @@
128131
"read-last-lines": "^1.1.0",
129132
"requirejs": "^2.3.1",
130133
"through2": "^2.0.3",
131-
"uglify-js": "^2.7.5",
134+
"uglify-js": "~2.7.5",
132135
"watchify": "^3.9.0",
133136
"xml2js": "^0.4.16"
134137
}

tasks/ci_test.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
EXIT_STATE=0
4+
5+
case $CIRCLE_NODE_INDEX in
6+
7+
0)
8+
npm run test-image || EXIT_STATE=$?
9+
npm run test-image-gl2d || EXIT_STATE=$?
10+
npm run test-export || EXIT_STATE=$?
11+
npm run test-syntax || EXIT_STATE=$?
12+
npm run lint || EXIT_STATE=$?
13+
exit $EXIT_STATE
14+
;;
15+
16+
1)
17+
npm run test-jasmine || EXIT_STATE=$?
18+
npm run test-bundle || EXIT_STATE=$?
19+
exit $EXIT_STATE
20+
;;
21+
22+
esac

tasks/docker.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,5 @@ switch(arg) {
4646
break;
4747
}
4848

49-
// Log command string on CircleCI, to then `eval` them,
50-
// which appears to be more reliable then calling `child_process.exec()`
51-
if(isCI) {
52-
console.log(cmd);
53-
}
54-
else {
55-
console.log(msg);
56-
common.execCmd(cmd, cb, errorCb);
57-
}
49+
console.log(msg);
50+
common.execCmd(cmd, cb, errorCb);

tasks/noci_test.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#! /bin/bash
2+
3+
EXIT_STATE=0
4+
5+
# tests that aren't run on CI
6+
7+
# jasmine specs with @noCI tag
8+
npm run citest-jasmine -- tests/*_test.js --tags noCI || EXIT_STATE=$?
9+
10+
# mapbox image tests take too much resources on CI
11+
npm run test-image -- mapbox_* || EXIT_STATE=$?
12+
13+
# run gl2d image test again (some mocks are skipped on CI)
14+
npm run test-image-gl2d || EXIT_STATE=$?
15+
16+
exit $EXIT_STATE

tasks/test_export.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ var cmd = containerCommands.getRunCmd(
1414
);
1515

1616
console.log(msg);
17-
common.execCmd(cmd);
17+
common.execCmd(containerCommands.ping, function() {
18+
common.execCmd(cmd);
19+
});

tasks/test_image.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ var cmd = containerCommands.getRunCmd(
1414
);
1515

1616
console.log(msg);
17-
common.execCmd(cmd);
17+
common.execCmd(containerCommands.ping, function() {
18+
common.execCmd(cmd);
19+
});

tasks/util/container_commands.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ containerCommands.setup = [
2222
containerCommands.injectEnv,
2323
containerCommands.restart,
2424
'sleep 1',
25-
containerCommands.ping,
26-
'echo '
2725
].join(' && ');
2826

2927
containerCommands.dockerRun = [

test/jasmine/assets/has_webgl_support.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

test/jasmine/karma.ciconf.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)