Skip to content

Commit 9fdcdf4

Browse files
filipesilvaKeen Yee Liau
authored and
Keen Yee Liau
committed
ci: add back angular snapshot e2e on master
1 parent b403aa6 commit 9fdcdf4

File tree

10 files changed

+39
-45
lines changed

10 files changed

+39
-45
lines changed

.circleci/config.yml

+17
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ jobs:
101101
- run: npm install --global npm@6
102102
- run: xvfb-run -a node ./tests/legacy-cli/run_e2e --glob=tests/basic/*
103103

104+
e2e-cli-ng-snapshots:
105+
<<: *defaults
106+
environment:
107+
BASH_ENV: ~/.profile
108+
resource_class: xlarge
109+
parallelism: 4
110+
steps:
111+
- attach_workspace: *attach_options
112+
- run: npm install --global npm@6
113+
- run: xvfb-run -a node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} --ng-snapshots
114+
104115
build:
105116
<<: *defaults
106117
steps:
@@ -170,6 +181,12 @@ workflows:
170181
- e2e-node-8:
171182
requires:
172183
- build
184+
- e2e-cli-ng-snapshots:
185+
requires:
186+
- build
187+
filters:
188+
branches:
189+
only: master
173190
- snapshot_publish:
174191
requires:
175192
- test

tests/legacy-cli/e2e/setup/015-build.ts

+1-29
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,5 @@ export default function() {
1212
return;
1313
}
1414

15-
return npm('run', 'build', '--', '--local')
16-
.then(() => {
17-
if (!argv.nightly && !argv['ng-sha']) {
18-
return;
19-
}
20-
21-
console.log('Updating package.json from dist for nightly Angular packages...');
22-
const label = argv['ng-sha'] ? `#2.0.0-${argv['ng-sha']}` : '';
23-
24-
return Promise.all(Object.keys(packages).map(pkgName => {
25-
return updateJsonFile(join(packages[pkgName].dist, 'package.json'), json => {
26-
Object.keys(json['dependencies'] || {})
27-
.filter(name => name.match(/^@angular\//))
28-
.forEach(name => {
29-
const pkgName = name.split(/\//)[1];
30-
json['dependencies'][`@angular/${pkgName}`]
31-
= `github:angular/${pkgName}-builds${label}`;
32-
});
33-
34-
Object.keys(json['devDependencies'] || {})
35-
.filter(name => name.match(/^@angular\//))
36-
.forEach(name => {
37-
const pkgName = name.split(/\//)[1];
38-
json['devDependencies'][`@angular/${pkgName}`]
39-
= `github:angular/${pkgName}-builds${label}`;
40-
});
41-
});
42-
}));
43-
});
15+
return npm('run', 'build', '--', '--local');
4416
}

tests/legacy-cli/e2e/setup/500-create-project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default async function() {
3737
.then(() => useCIChrome('e2e'))
3838
.then(() => useCIChrome('src'))
3939
.then(() => argv['ng-version'] ? useNgVersion(argv['ng-version']) : Promise.resolve())
40-
.then(() => argv.nightly || argv['ng-sha'] ? useSha() : Promise.resolve())
40+
.then(() => argv['ng-snapshots'] || argv['ng-tag'] ? useSha() : Promise.resolve())
4141
// npm link on Circle CI is very noisy.
4242
.then(() => silentNpm('install'))
4343
.then(() => ng('version'))

tests/legacy-cli/e2e/tests/build/build-app-shell-with-schematic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function () {
1919

2020
let platformServerVersion = readNgVersion();
2121

22-
if (getGlobalVariable('argv').nightly) {
22+
if (getGlobalVariable('argv')['ng-snapshots']) {
2323
platformServerVersion = 'github:angular/platform-server-builds';
2424
}
2525

tests/legacy-cli/e2e/tests/build/build-app-shell.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function () {
2020

2121
let platformServerVersion = readNgVersion();
2222

23-
if (getGlobalVariable('argv').nightly) {
23+
if (getGlobalVariable('argv')['ng-snapshots']) {
2424
platformServerVersion = 'github:angular/platform-server-builds';
2525
}
2626

tests/legacy-cli/e2e/tests/build/platform-server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function () {
2121

2222
let platformServerVersion = readNgVersion();
2323

24-
if (getGlobalVariable('argv').nightly) {
24+
if (getGlobalVariable('argv')['ng-snapshots']) {
2525
platformServerVersion = 'github:angular/platform-server-builds';
2626
}
2727

tests/legacy-cli/e2e/tests/build/rebuild-replacements.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default async function() {
1919

2020
// Should trigger a rebuild.
2121
await appendToFile('src/environments/environment.prod.ts', `console.log('PROD');`);
22-
await waitForAnyProcessOutputToMatch(webpackGoodRegEx, 40000);
22+
await waitForAnyProcessOutputToMatch(webpackGoodRegEx, 45000);
2323
} catch (e) {
2424
error = e;
2525
}

tests/legacy-cli/e2e/tests/build/typescript/typescript-2_7.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default async function () {
66
// TypeScript minor versions.
77
return;
88

9-
// Disable the strict TS version check for nightly
9+
// Disable the strict TS version check for snapshots
1010
await updateJsonFile('src/tsconfig.app.json', configJson => {
1111
configJson.angularCompilerOptions = {
1212
...configJson.angularCompilerOptions,

tests/legacy-cli/e2e/utils/project.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function createProject(name: string, ...args: string[]) {
4444
.then(() => useDevKitSnapshots())
4545
.then(() => argv['ng2'] ? useNg2() : Promise.resolve())
4646
.then(() => argv['ng4'] ? useNg4() : Promise.resolve())
47-
.then(() => argv.nightly || argv['ng-sha'] ? useSha() : Promise.resolve())
47+
.then(() => argv['ng-snapshots'] || argv['ng-tag'] ? useSha() : Promise.resolve())
4848
.then(() => console.log(`Project ${name} created... Installing npm.`))
4949
.then(() => silentNpm('install'))
5050
.then(() => useCIDefaults(name));
@@ -110,10 +110,13 @@ export function useBuiltPackages() {
110110

111111
export function useSha() {
112112
const argv = getGlobalVariable('argv');
113-
if (argv.nightly || argv['ng-sha']) {
114-
const label = argv['ng-sha'] ? `#2.0.0-${argv['ng-sha']}` : '';
113+
if (argv['ng-snapshots'] || argv['ng-tag']) {
114+
// We need more than the sha here, version is also needed. Examples of latest tags:
115+
// 7.0.0-beta.4+dd2a650
116+
// 6.1.6+4a8d56a
117+
const label = argv['ng-tag'] ? argv['ng-tag'] : '';
115118
return updateJsonFile('package.json', json => {
116-
// Install over the project with nightly builds.
119+
// Install over the project with snapshot builds.
117120
Object.keys(json['dependencies'] || {})
118121
.filter(name => name.match(/^@angular\//))
119122
.forEach(name => {
@@ -135,6 +138,8 @@ export function useSha() {
135138
json['devDependencies'][`@angular/${pkgName}`]
136139
= `github:angular/${pkgName}-builds${label}`;
137140
});
141+
142+
json['devDependencies']['typescript'] = '~3.0.1';
138143
});
139144
} else {
140145
return Promise.resolve();
@@ -143,7 +148,7 @@ export function useSha() {
143148

144149
export function useNgVersion(version: string) {
145150
return updateJsonFile('package.json', json => {
146-
// Install over the project with nightly builds.
151+
// Install over the project with specific versions.
147152
Object.keys(json['dependencies'] || {})
148153
.filter(name => name.match(/^@angular\//))
149154
.forEach(name => {

tests/legacy-cli/e2e_runner.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ Error.stackTraceLimit = Infinity;
2626
* rerun tests.
2727
* --noglobal Skip linking your local @angular/cli directory. Can save a few seconds.
2828
* --nosilent Never silence ng commands.
29-
* --ng-sha=SHA Use a specific ng-sha. Similar to nightly but point to a master SHA instead
30-
* of using the latest.
29+
* --ng-tag=TAG Use a specific tag for build snapshots. Similar to ng-snapshots but point to a
30+
* tag of using the latest master.
31+
* --ng-snapshots Install angular snapshot builds in the test project.
3132
* --glob Run tests matching this glob pattern (relative to tests/e2e/).
3233
* --ignore Ignore tests matching this glob pattern.
33-
* --nightly Install angular nightly builds over the test project.
3434
* --reuse=/path Use a path instead of create a new project. That project should have been
3535
* created, and npm installed. Ideally you want a project created by a previous
3636
* run of e2e.
@@ -46,13 +46,13 @@ const argv = minimist(process.argv.slice(2), {
4646
'appveyor',
4747
'debug',
4848
'eject',
49-
'nightly',
49+
'ng-snapshots',
5050
'noglobal',
5151
'nosilent',
5252
'noproject',
5353
'verbose',
5454
],
55-
'string': ['devkit', 'glob', 'ignore', 'reuse', 'ng-sha', 'tmpdir', 'ng-version'],
55+
'string': ['devkit', 'glob', 'ignore', 'reuse', 'ng-tag', 'tmpdir', 'ng-version'],
5656
'number': ['nb-shards', 'shard'],
5757
});
5858

0 commit comments

Comments
 (0)