Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 79b64b2

Browse files
committed
fix(ci): Inherit stdio from test process when running in CI.
CircleCI will timeout the test if it doesn't see any output for 10 minutes. When running in CI, we need to inherit stdio so we don't get killed if the tests run slowly due to timeouts. This will also give us more info for debugging.
1 parent 0e0490c commit 79b64b2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

scripts/test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,9 @@ executor.addCommandlineTest('node built/cli.js spec/angular2TimeoutConf.js')
144144
{message: 'Timed out waiting for asynchronous Angular tasks to finish'},
145145
]);
146146

147-
executor.execute();
147+
// When running in CI, make sure we show stdout from the tests.
148+
if (process.env['CI']) {
149+
executor.execute(true);
150+
} else {
151+
executor.execute();
152+
}

scripts/test/test_util.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var CommandlineTest = function(command) {
8686
output += data;
8787
});
8888
} else {
89-
test_process = child_process.spawn(args[0], args.slice(1), {stdio: 'inherit'});
89+
test_process = child_process.spawn(args[0], args.slice(1), {stdio: 'inherit', stderr: 'inherit'});
9090
}
9191

9292
test_process.on('error', function(err) {
@@ -202,12 +202,15 @@ exports.Executor = function() {
202202
return test;
203203
};
204204

205-
this.execute = function() {
205+
this.execute = function(showStdio) {
206206
var failed = false;
207207

208208
(function runTests(i) {
209209
if (i < tests.length) {
210210
console.log('running: ' + tests[i].command_);
211+
if (showStdio) {
212+
tests[i].alwaysEnableStdio();
213+
}
211214
tests[i].run().then(function() {
212215
console.log('>>> \033[1;32mpass\033[0m');
213216
}, function(err) {

0 commit comments

Comments
 (0)