Skip to content

Commit 359ec37

Browse files
committed
ci: optionals only on branches, no silent for small tests
1 parent e8f6b75 commit 359ec37

File tree

3 files changed

+36
-17
lines changed

3 files changed

+36
-17
lines changed

.travis.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ env:
1313
- DBUS_SESSION_BUS_ADDRESS=/dev/null
1414

1515

16-
matrix:
17-
allow_failures:
18-
- env: nightly
19-
- env: ng2
20-
- node_js: "7"
21-
- node_js: "8"
22-
23-
2416
matrix:
2517
fast_finish: true
2618
allow_failures:
@@ -40,19 +32,19 @@ matrix:
4032
env: test
4133
- node_js: "6"
4234
os: linux
43-
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=0
35+
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=0 --nosilent
4436
env: e2e-0
4537
- node_js: "6"
4638
os: linux
47-
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=1
39+
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=1 --nosilent
4840
env: e2e-1
4941
- node_js: "6"
5042
os: linux
51-
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=2
43+
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=2 --nosilent
5244
env: e2e-2
5345
- node_js: "6"
5446
os: linux
55-
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=3
47+
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=3 --nosilent
5648
env: e2e-3
5749
- node_js: "6"
5850
os: linux
@@ -64,18 +56,26 @@ matrix:
6456
os: linux
6557
script: node tests/run_e2e.js --ng2 "--glob=tests/{build,test,misc}/**"
6658
env: ng2
59+
on:
60+
all_branches: true
6761
- node_js: "6"
6862
os: linux
6963
script: node tests/run_e2e.js "--nightly --glob=tests/{build,test,misc}/**"
7064
env: nightly
65+
on:
66+
all_branches: true
7167
- node_js: "7"
7268
os: linux
7369
script: node tests/run_e2e.js "--glob=tests/{build,test,misc}/**"
7470
env: node7
71+
on:
72+
all_branches: true
7573
- node_js: "8"
7674
os: linux
7775
script: node tests/run_e2e.js "--glob=tests/build/**"
7876
env: node8
77+
on:
78+
all_branches: true
7979

8080
- stage: deploy
8181
script: skip

tests/e2e/utils/process.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,12 @@ export function silentExecAndWaitForOutputToMatch(cmd: string, args: string[], m
139139

140140
let npmInstalledEject = false;
141141
export function ng(...args: string[]) {
142+
const argv = getGlobalVariable('argv');
143+
const maybeSilentNg = argv['nosilent'] ? noSilentNg : silentNg;
142144
if (['build', 'serve', 'test', 'e2e', 'xi18n'].indexOf(args[0]) != -1) {
143145
// If we have the --eject, use webpack for the test.
144-
const argv = getGlobalVariable('argv');
145146
if (args[0] == 'build' && argv.eject) {
146-
return silentNg('eject', ...args.slice(1), '--force')
147+
return maybeSilentNg('eject', ...args.slice(1), '--force')
147148
.then(() => {
148149
if (!npmInstalledEject) {
149150
npmInstalledEject = true;
@@ -153,14 +154,22 @@ export function ng(...args: string[]) {
153154
})
154155
.then(() => rimraf('dist'))
155156
.then(() => _exec({silent: true}, 'node_modules/.bin/webpack', []));
157+
} else if (args[0] == 'e2e') {
158+
// Wait 1 second before running any end-to-end test.
159+
return new Promise(resolve => setTimeout(resolve, 1000))
160+
.then(() => maybeSilentNg(...args));
156161
}
157162

158-
return silentNg(...args);
163+
return maybeSilentNg(...args);
159164
} else {
160-
return _exec({}, 'ng', args);
165+
return noSilentNg(...args);
161166
}
162167
}
163168

169+
export function noSilentNg(...args: string[]) {
170+
return _exec({}, 'ng', args);
171+
}
172+
164173
export function silentNg(...args: string[]) {
165174
return _exec({silent: true}, 'ng', args);
166175
}

tests/e2e_runner.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Error.stackTraceLimit = Infinity;
2828
* --nobuild Skip building the packages. Use with --nolink and --reuse to quickly
2929
* rerun tests.
3030
* --nolink Skip linking your local @angular/cli directory. Can save a few seconds.
31+
* --nosilent Never silence ng commands.
3132
* --ng-sha=SHA Use a specific ng-sha. Similar to nightly but point to a master SHA instead
3233
* of using the latest.
3334
* --glob Run tests matching this glob pattern (relative to tests/e2e/).
@@ -42,7 +43,16 @@ Error.stackTraceLimit = Infinity;
4243
* If unnamed flags are passed in, the list of tests will be filtered to include only those passed.
4344
*/
4445
const argv = minimist(process.argv.slice(2), {
45-
'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose', 'eject', 'appveyor'],
46+
'boolean': [
47+
'appveyor',
48+
'debug',
49+
'eject',
50+
'nightly',
51+
'nolink',
52+
'nosilent',
53+
'noproject',
54+
'verbose',
55+
],
4656
'string': ['glob', 'ignore', 'reuse', 'ng-sha', ],
4757
'number': ['nb-shards', 'shard']
4858
});

0 commit comments

Comments
 (0)