Skip to content

Commit

Permalink
ci: optionals only on branches, no silent for small tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Jul 12, 2017
1 parent e8f6b75 commit 359ec37
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 17 deletions.
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ env:
- DBUS_SESSION_BUS_ADDRESS=/dev/null


matrix:
allow_failures:
- env: nightly
- env: ng2
- node_js: "7"
- node_js: "8"


matrix:
fast_finish: true
allow_failures:
Expand All @@ -40,19 +32,19 @@ matrix:
env: test
- node_js: "6"
os: linux
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=0
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=0 --nosilent
env: e2e-0
- node_js: "6"
os: linux
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=1
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=1 --nosilent
env: e2e-1
- node_js: "6"
os: linux
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=2
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=2 --nosilent
env: e2e-2
- node_js: "6"
os: linux
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=3
script: node tests/run_e2e.js "--ignore=**/tests/build/**" --nb-shards=4 --shard=3 --nosilent
env: e2e-3
- node_js: "6"
os: linux
Expand All @@ -64,18 +56,26 @@ matrix:
os: linux
script: node tests/run_e2e.js --ng2 "--glob=tests/{build,test,misc}/**"
env: ng2
on:
all_branches: true
- node_js: "6"
os: linux
script: node tests/run_e2e.js "--nightly --glob=tests/{build,test,misc}/**"
env: nightly
on:
all_branches: true
- node_js: "7"
os: linux
script: node tests/run_e2e.js "--glob=tests/{build,test,misc}/**"
env: node7
on:
all_branches: true
- node_js: "8"
os: linux
script: node tests/run_e2e.js "--glob=tests/build/**"
env: node8
on:
all_branches: true

- stage: deploy
script: skip
Expand Down
17 changes: 13 additions & 4 deletions tests/e2e/utils/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ export function silentExecAndWaitForOutputToMatch(cmd: string, args: string[], m

let npmInstalledEject = false;
export function ng(...args: string[]) {
const argv = getGlobalVariable('argv');
const maybeSilentNg = argv['nosilent'] ? noSilentNg : silentNg;
if (['build', 'serve', 'test', 'e2e', 'xi18n'].indexOf(args[0]) != -1) {
// If we have the --eject, use webpack for the test.
const argv = getGlobalVariable('argv');
if (args[0] == 'build' && argv.eject) {
return silentNg('eject', ...args.slice(1), '--force')
return maybeSilentNg('eject', ...args.slice(1), '--force')
.then(() => {
if (!npmInstalledEject) {
npmInstalledEject = true;
Expand All @@ -153,14 +154,22 @@ export function ng(...args: string[]) {
})
.then(() => rimraf('dist'))
.then(() => _exec({silent: true}, 'node_modules/.bin/webpack', []));
} else if (args[0] == 'e2e') {
// Wait 1 second before running any end-to-end test.
return new Promise(resolve => setTimeout(resolve, 1000))
.then(() => maybeSilentNg(...args));
}

return silentNg(...args);
return maybeSilentNg(...args);
} else {
return _exec({}, 'ng', args);
return noSilentNg(...args);
}
}

export function noSilentNg(...args: string[]) {
return _exec({}, 'ng', args);
}

export function silentNg(...args: string[]) {
return _exec({silent: true}, 'ng', args);
}
Expand Down
12 changes: 11 additions & 1 deletion tests/e2e_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Error.stackTraceLimit = Infinity;
* --nobuild Skip building the packages. Use with --nolink and --reuse to quickly
* rerun tests.
* --nolink Skip linking your local @angular/cli directory. Can save a few seconds.
* --nosilent Never silence ng commands.
* --ng-sha=SHA Use a specific ng-sha. Similar to nightly but point to a master SHA instead
* of using the latest.
* --glob Run tests matching this glob pattern (relative to tests/e2e/).
Expand All @@ -42,7 +43,16 @@ Error.stackTraceLimit = Infinity;
* If unnamed flags are passed in, the list of tests will be filtered to include only those passed.
*/
const argv = minimist(process.argv.slice(2), {
'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose', 'eject', 'appveyor'],
'boolean': [
'appveyor',
'debug',
'eject',
'nightly',
'nolink',
'nosilent',
'noproject',
'verbose',
],
'string': ['glob', 'ignore', 'reuse', 'ng-sha', ],
'number': ['nb-shards', 'shard']
});
Expand Down

0 comments on commit 359ec37

Please sign in to comment.