mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-14 01:08:29 +08:00
ci: add back angular snapshot e2e on master
This commit is contained in:
parent
b403aa69c1
commit
9fdcdf49bb
@ -101,6 +101,17 @@ jobs:
|
||||
- run: npm install --global npm@6
|
||||
- run: xvfb-run -a node ./tests/legacy-cli/run_e2e --glob=tests/basic/*
|
||||
|
||||
e2e-cli-ng-snapshots:
|
||||
<<: *defaults
|
||||
environment:
|
||||
BASH_ENV: ~/.profile
|
||||
resource_class: xlarge
|
||||
parallelism: 4
|
||||
steps:
|
||||
- attach_workspace: *attach_options
|
||||
- run: npm install --global npm@6
|
||||
- run: xvfb-run -a node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} --ng-snapshots
|
||||
|
||||
build:
|
||||
<<: *defaults
|
||||
steps:
|
||||
@ -170,6 +181,12 @@ workflows:
|
||||
- e2e-node-8:
|
||||
requires:
|
||||
- build
|
||||
- e2e-cli-ng-snapshots:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
- snapshot_publish:
|
||||
requires:
|
||||
- test
|
||||
|
@ -12,33 +12,5 @@ export default function() {
|
||||
return;
|
||||
}
|
||||
|
||||
return npm('run', 'build', '--', '--local')
|
||||
.then(() => {
|
||||
if (!argv.nightly && !argv['ng-sha']) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Updating package.json from dist for nightly Angular packages...');
|
||||
const label = argv['ng-sha'] ? `#2.0.0-${argv['ng-sha']}` : '';
|
||||
|
||||
return Promise.all(Object.keys(packages).map(pkgName => {
|
||||
return updateJsonFile(join(packages[pkgName].dist, 'package.json'), json => {
|
||||
Object.keys(json['dependencies'] || {})
|
||||
.filter(name => name.match(/^@angular\//))
|
||||
.forEach(name => {
|
||||
const pkgName = name.split(/\//)[1];
|
||||
json['dependencies'][`@angular/${pkgName}`]
|
||||
= `github:angular/${pkgName}-builds${label}`;
|
||||
});
|
||||
|
||||
Object.keys(json['devDependencies'] || {})
|
||||
.filter(name => name.match(/^@angular\//))
|
||||
.forEach(name => {
|
||||
const pkgName = name.split(/\//)[1];
|
||||
json['devDependencies'][`@angular/${pkgName}`]
|
||||
= `github:angular/${pkgName}-builds${label}`;
|
||||
});
|
||||
});
|
||||
}));
|
||||
});
|
||||
return npm('run', 'build', '--', '--local');
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ export default async function() {
|
||||
.then(() => useCIChrome('e2e'))
|
||||
.then(() => useCIChrome('src'))
|
||||
.then(() => argv['ng-version'] ? useNgVersion(argv['ng-version']) : Promise.resolve())
|
||||
.then(() => argv.nightly || argv['ng-sha'] ? useSha() : Promise.resolve())
|
||||
.then(() => argv['ng-snapshots'] || argv['ng-tag'] ? useSha() : Promise.resolve())
|
||||
// npm link on Circle CI is very noisy.
|
||||
.then(() => silentNpm('install'))
|
||||
.then(() => ng('version'))
|
||||
|
@ -19,7 +19,7 @@ export default function () {
|
||||
|
||||
let platformServerVersion = readNgVersion();
|
||||
|
||||
if (getGlobalVariable('argv').nightly) {
|
||||
if (getGlobalVariable('argv')['ng-snapshots']) {
|
||||
platformServerVersion = 'github:angular/platform-server-builds';
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ export default function () {
|
||||
|
||||
let platformServerVersion = readNgVersion();
|
||||
|
||||
if (getGlobalVariable('argv').nightly) {
|
||||
if (getGlobalVariable('argv')['ng-snapshots']) {
|
||||
platformServerVersion = 'github:angular/platform-server-builds';
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ export default function () {
|
||||
|
||||
let platformServerVersion = readNgVersion();
|
||||
|
||||
if (getGlobalVariable('argv').nightly) {
|
||||
if (getGlobalVariable('argv')['ng-snapshots']) {
|
||||
platformServerVersion = 'github:angular/platform-server-builds';
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ export default async function() {
|
||||
|
||||
// Should trigger a rebuild.
|
||||
await appendToFile('src/environments/environment.prod.ts', `console.log('PROD');`);
|
||||
await waitForAnyProcessOutputToMatch(webpackGoodRegEx, 40000);
|
||||
await waitForAnyProcessOutputToMatch(webpackGoodRegEx, 45000);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ export default async function () {
|
||||
// TypeScript minor versions.
|
||||
return;
|
||||
|
||||
// Disable the strict TS version check for nightly
|
||||
// Disable the strict TS version check for snapshots
|
||||
await updateJsonFile('src/tsconfig.app.json', configJson => {
|
||||
configJson.angularCompilerOptions = {
|
||||
...configJson.angularCompilerOptions,
|
||||
|
@ -44,7 +44,7 @@ export function createProject(name: string, ...args: string[]) {
|
||||
.then(() => useDevKitSnapshots())
|
||||
.then(() => argv['ng2'] ? useNg2() : Promise.resolve())
|
||||
.then(() => argv['ng4'] ? useNg4() : Promise.resolve())
|
||||
.then(() => argv.nightly || argv['ng-sha'] ? useSha() : Promise.resolve())
|
||||
.then(() => argv['ng-snapshots'] || argv['ng-tag'] ? useSha() : Promise.resolve())
|
||||
.then(() => console.log(`Project ${name} created... Installing npm.`))
|
||||
.then(() => silentNpm('install'))
|
||||
.then(() => useCIDefaults(name));
|
||||
@ -110,10 +110,13 @@ export function useBuiltPackages() {
|
||||
|
||||
export function useSha() {
|
||||
const argv = getGlobalVariable('argv');
|
||||
if (argv.nightly || argv['ng-sha']) {
|
||||
const label = argv['ng-sha'] ? `#2.0.0-${argv['ng-sha']}` : '';
|
||||
if (argv['ng-snapshots'] || argv['ng-tag']) {
|
||||
// We need more than the sha here, version is also needed. Examples of latest tags:
|
||||
// 7.0.0-beta.4+dd2a650
|
||||
// 6.1.6+4a8d56a
|
||||
const label = argv['ng-tag'] ? argv['ng-tag'] : '';
|
||||
return updateJsonFile('package.json', json => {
|
||||
// Install over the project with nightly builds.
|
||||
// Install over the project with snapshot builds.
|
||||
Object.keys(json['dependencies'] || {})
|
||||
.filter(name => name.match(/^@angular\//))
|
||||
.forEach(name => {
|
||||
@ -135,6 +138,8 @@ export function useSha() {
|
||||
json['devDependencies'][`@angular/${pkgName}`]
|
||||
= `github:angular/${pkgName}-builds${label}`;
|
||||
});
|
||||
|
||||
json['devDependencies']['typescript'] = '~3.0.1';
|
||||
});
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
@ -143,7 +148,7 @@ export function useSha() {
|
||||
|
||||
export function useNgVersion(version: string) {
|
||||
return updateJsonFile('package.json', json => {
|
||||
// Install over the project with nightly builds.
|
||||
// Install over the project with specific versions.
|
||||
Object.keys(json['dependencies'] || {})
|
||||
.filter(name => name.match(/^@angular\//))
|
||||
.forEach(name => {
|
||||
|
@ -26,11 +26,11 @@ Error.stackTraceLimit = Infinity;
|
||||
* rerun tests.
|
||||
* --noglobal 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.
|
||||
* --ng-tag=TAG Use a specific tag for build snapshots. Similar to ng-snapshots but point to a
|
||||
* tag of using the latest master.
|
||||
* --ng-snapshots Install angular snapshot builds in the test project.
|
||||
* --glob Run tests matching this glob pattern (relative to tests/e2e/).
|
||||
* --ignore Ignore tests matching this glob pattern.
|
||||
* --nightly Install angular nightly builds over the test project.
|
||||
* --reuse=/path Use a path instead of create a new project. That project should have been
|
||||
* created, and npm installed. Ideally you want a project created by a previous
|
||||
* run of e2e.
|
||||
@ -46,13 +46,13 @@ const argv = minimist(process.argv.slice(2), {
|
||||
'appveyor',
|
||||
'debug',
|
||||
'eject',
|
||||
'nightly',
|
||||
'ng-snapshots',
|
||||
'noglobal',
|
||||
'nosilent',
|
||||
'noproject',
|
||||
'verbose',
|
||||
],
|
||||
'string': ['devkit', 'glob', 'ignore', 'reuse', 'ng-sha', 'tmpdir', 'ng-version'],
|
||||
'string': ['devkit', 'glob', 'ignore', 'reuse', 'ng-tag', 'tmpdir', 'ng-version'],
|
||||
'number': ['nb-shards', 'shard'],
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user