Skip to content

Commit 14621e1

Browse files
committed
revamp circle.yml for ubuntu 14.04 with 2x parallel containers !!!
- add ci_tesh.sh that splits test command between 2 containers - make `npm run lint` exit with exit code 1 if fails - rm `eval ($node tasks/docker.js ---)` hack (no longer needed in 14.04) - ping imagetest server from outside container, as pinging from inside was failling in 14.04 - add more robust `npm i` step
1 parent 100b993 commit 14621e1

File tree

7 files changed

+41
-29
lines changed

7 files changed

+41
-29
lines changed

circle.yml

+9-14
Original file line numberDiff line numberDiff line change
@@ -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

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
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",

tasks/ci_test.sh

+22
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 citest-jasmine || EXIT_STATE=$?
18+
npm run test-bundle || EXIT_STATE=$?
19+
exit $EXIT_STATE
20+
;;
21+
22+
esac

tasks/docker.js

+2-9
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/test_export.js

+3-1
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

+3-1
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

-2
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 = [

0 commit comments

Comments
 (0)