Skip to content

Commit a9f4651

Browse files
committed
proper execution of the integration tests
1 parent 5f03535 commit a9f4651

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ script:
77
- lerna bootstrap --ignore={demos}
88
- yarn test:unit
99
- lerna run test
10-
- node ./tests/bin/is-first-ci-job.js && yarn test:integration:build || echo
11-
- node ./tests/bin/is-first-ci-job.js && yarn test:integration || echo
10+
- node ./tests/bin/run-on-first-ci-job.js && yarn test:integration:build
11+
- node ./tests/bin/run-on-first-ci-job.js && yarn test:integration
1212
after_success: "yarn coveralls"
1313
cache:
1414
yarn: true

tests/bin/is-first-ci-job.js

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

tests/bin/run-on-first-ci-job.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const ciJobNumber = require("ci-job-number");
2+
const { spawn } = require("child_process");
3+
4+
if (ciJobNumber() !== 1) {
5+
// If it's not the first job, then just return with a success code.
6+
process.exit(0);
7+
}
8+
9+
// Run the command otherwise.
10+
const command = process.argv[2];
11+
const args = process.argv.slice(3);
12+
13+
const execution = spawn(command, args);
14+
15+
execution.stdout.on("data", data => {
16+
process.stdout.write(data.toString());
17+
});
18+
19+
execution.stderr.on("data", data => {
20+
console.error(data.toString());
21+
});

0 commit comments

Comments
 (0)