test(aio): fix running docs examples against local builds (#18520)

This commit also updates the version of `@angular/cli` used for docs examples.
The previous (transient) dependency `@ngtools/webpack` was not compatible with
`@angular/compiler-cli@>=5` and was breaking when running against the local
builds (currently at 5.0.0-beta.2). The version of `@ngtools/webpack` used by
the latest `@angular/cli` version is compatible with `@angular/compiler-cli@5`.
This commit is contained in:
George Kalpakas 2017-08-10 00:21:10 +03:00 committed by Victor Berchet
parent fd6ae571b8
commit 7f2037f0b6
7 changed files with 123 additions and 47 deletions

View File

@ -41,12 +41,9 @@ const ANGULAR_PACKAGES = [
'platform-browser-dynamic',
'platform-server',
'router',
'tsc-wrapped',
'upgrade',
];
const ANGULAR_TOOLS_PACKAGES_PATH = path.resolve(ANGULAR_DIST_PATH, 'tools', '@angular');
const ANGULAR_TOOLS_PACKAGES = [
'tsc-wrapped'
];
const EXAMPLE_CONFIG_FILENAME = 'example-config.json';
@ -63,7 +60,6 @@ class ExampleBoilerPlate {
// Replace the Angular packages with those from the dist folder, if necessary
if (useLocal) {
ANGULAR_PACKAGES.forEach(packageName => this.overridePackage(ANGULAR_PACKAGES_PATH, packageName));
ANGULAR_TOOLS_PACKAGES.forEach(packageName => this.overridePackage(ANGULAR_TOOLS_PACKAGES_PATH, packageName));
}
// Get all the examples folders, indicated by those that contain a `example-config.json` file
@ -111,7 +107,7 @@ class ExampleBoilerPlate {
const sourceFolder = path.resolve(basePath, packageName);
const destinationFolder = path.resolve(SHARED_NODE_MODULES_PATH, '@angular', packageName);
shelljs.rm('-rf', destinationFolder);
fs.ensureSymlinkSync(sourceFolder, destinationFolder);
fs.copySync(sourceFolder, destinationFolder);
}
getFoldersContaining(basePath, filename, ignore) {

View File

@ -30,8 +30,9 @@ describe('example-boilerplate tool', () => {
exampleBoilerPlate.add(true);
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledTimes(numberOfAngularPackages + numberOfAngularToolsPackages);
// for example
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/packages-dist'), 'common');
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/packages-dist'), 'core');
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/tools/@angular'), 'tsc-wrapped');
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/packages-dist'), 'tsc-wrapped');
});
it('should process all the example folders', () => {
@ -90,7 +91,7 @@ describe('example-boilerplate tool', () => {
describe('overridePackage', () => {
beforeEach(() => {
spyOn(shelljs, 'rm');
spyOn(fs, 'ensureSymlinkSync');
spyOn(fs, 'copySync');
});
it('should remove the original package from the shared node_modules folder', () => {
@ -98,9 +99,9 @@ describe('example-boilerplate tool', () => {
expect(shelljs.rm).toHaveBeenCalledWith('-rf', path.resolve(__dirname, 'shared/node_modules/@angular/somePackage'));
});
it('should symlink the source folder to the shared node_modules folder', () => {
it('should copy the source folder to the shared node_modules folder', () => {
exampleBoilerPlate.overridePackage('base/path', 'somePackage');
expect(fs.ensureSymlinkSync).toHaveBeenCalledWith(path.resolve('base/path/somePackage'), path.resolve(__dirname, 'shared/node_modules/@angular/somePackage'));
expect(fs.copySync).toHaveBeenCalledWith(path.resolve('base/path/somePackage'), path.resolve(__dirname, 'shared/node_modules/@angular/somePackage'));
});
});

View File

@ -39,7 +39,7 @@ function runE2e() {
if (argv.setup) {
// Run setup.
console.log('runE2e: copy boilerplate');
const spawnInfo = spawnExt('yarn', ['boilerplate:add', argv.local ? '-- --local': ''], { cwd: AIO_PATH });
const spawnInfo = spawnExt('yarn', ['boilerplate:add', '--', argv.local ? '--local' : ''], { cwd: AIO_PATH });
promise = spawnInfo.promise
.then(() => {
console.log('runE2e: update webdriver');

View File

@ -32,7 +32,7 @@
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "^1.2.0",
"@angular/cli": "^1.2.7",
"@types/angular": "^1.5.16",
"@types/angular-animate": "^1.5.5",
"@types/angular-cookies": "^1.4.2",

View File

@ -1,7 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# yarn v0.25.3
# node v7.8.0
"@angular/animations@~4.3.1":
@ -10,14 +8,15 @@
dependencies:
tslib "^1.7.1"
"@angular/cli@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-1.2.0.tgz#dfd8b8983ec37c2b6d7f902ead60396d7b571597"
"@angular/cli@^1.2.7":
version "1.2.7"
resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-1.2.7.tgz#dd20e8b0da24af5359077c05a6944823cb764132"
dependencies:
"@ngtools/json-schema" "1.1.0"
"@ngtools/webpack" "1.5.0"
"@ngtools/webpack" "1.5.5"
autoprefixer "^6.5.3"
chalk "^1.1.3"
chalk "^2.0.1"
circular-dependency-plugin "^3.0.0"
common-tags "^1.3.1"
core-object "^3.1.0"
css-loader "^0.28.1"
@ -29,7 +28,7 @@
exports-loader "^0.6.3"
extract-text-webpack-plugin "^2.1.0"
file-loader "^0.10.0"
fs-extra "^3.0.1"
fs-extra "^4.0.0"
get-caller-file "^1.0.0"
glob "^7.0.3"
heimdalljs "^0.2.4"
@ -39,7 +38,7 @@
inquirer "^3.0.0"
isbinaryfile "^3.0.0"
istanbul-instrumenter-loader "^2.0.0"
json-loader "^0.5.4"
karma-source-map-support "^1.2.0"
less "^2.7.2"
less-loader "^4.0.2"
license-webpack-plugin "^0.4.2"
@ -48,7 +47,7 @@
minimatch "^3.0.3"
node-modules-path "^1.0.0"
nopt "^4.0.1"
opn "4.0.2"
opn "~5.1.0"
portfinder "~1.0.12"
postcss-loader "^1.3.3"
postcss-url "^5.1.2"
@ -61,6 +60,7 @@
semver "^5.1.0"
silent-error "^1.0.0"
source-map-loader "^0.2.0"
source-map-support "^0.4.1"
style-loader "^0.13.1"
stylus "^0.54.5"
stylus-loader "^3.0.1"
@ -72,7 +72,7 @@
webpack-dev-middleware "^1.10.2"
webpack-dev-server "~2.4.5"
webpack-merge "^2.4.0"
zone.js "^0.8.4"
zone.js "^0.8.14"
optionalDependencies:
node-sass "^4.3.0"
@ -156,13 +156,12 @@
version "1.1.0"
resolved "https://registry.yarnpkg.com/@ngtools/json-schema/-/json-schema-1.1.0.tgz#c3a0c544d62392acc2813a42c8a0dc6f58f86922"
"@ngtools/webpack@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-1.5.0.tgz#b6be58d857d41f8999751d6bbc3d21e84bc977ca"
"@ngtools/webpack@1.5.5":
version "1.5.5"
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-1.5.5.tgz#d6e2a933184015653de3be33d38437fdd81009e7"
dependencies:
enhanced-resolve "^3.1.0"
loader-utils "^1.0.2"
magic-string "^0.19.0"
magic-string "^0.22.3"
source-map "^0.5.6"
"@types/angular-animate@^1.5.5":
@ -360,6 +359,12 @@ ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
ansi-styles@^3.1.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88"
dependencies:
color-convert "^1.9.0"
anymatch@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507"
@ -1385,6 +1390,14 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"
chalk@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d"
dependencies:
ansi-styles "^3.1.0"
escape-string-regexp "^1.0.5"
supports-color "^4.0.0"
chokidar@1.7.0, chokidar@^1.4.1, chokidar@^1.4.3, chokidar@^1.6.0, chokidar@^1.6.1:
version "1.7.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
@ -1406,6 +1419,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
dependencies:
inherits "^2.0.1"
circular-dependency-plugin@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/circular-dependency-plugin/-/circular-dependency-plugin-3.0.0.tgz#9b68692e35b0e3510998d0164b6ae5011bea5760"
clap@^1.0.9:
version "1.1.3"
resolved "https://registry.yarnpkg.com/clap/-/clap-1.1.3.tgz#b3bd36e93dd4cbfb395a3c26896352445265c05b"
@ -1476,7 +1493,7 @@ code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
color-convert@^1.3.0:
color-convert@^1.3.0, color-convert@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a"
dependencies:
@ -2592,7 +2609,7 @@ fs-access@^1.0.0:
dependencies:
null-check "^1.0.0"
fs-extra@3.0.1, fs-extra@^3.0.1:
fs-extra@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291"
dependencies:
@ -2609,6 +2626,14 @@ fs-extra@^0.23.1:
path-is-absolute "^1.0.0"
rimraf "^2.2.8"
fs-extra@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.1.tgz#7fc0c6c8957f983f57f306a24e5b9ddd8d0dd880"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^3.0.0"
universalify "^0.1.0"
fs-extra@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950"
@ -2843,6 +2868,10 @@ has-flag@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
has-flag@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51"
has-unicode@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
@ -3340,6 +3369,10 @@ is-utf8@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
is-wsl@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
isarray@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
@ -3539,6 +3572,12 @@ karma-phantomjs-launcher@^1.0.2:
lodash "^4.0.1"
phantomjs-prebuilt "^2.1.7"
karma-source-map-support@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/karma-source-map-support/-/karma-source-map-support-1.2.0.tgz#1bf81e7bb4b089627ab352ec4179e117c406a540"
dependencies:
source-map-support "^0.4.1"
karma-sourcemap-loader@^0.3.7:
version "0.3.7"
resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8"
@ -3803,6 +3842,12 @@ magic-string@^0.19.0:
dependencies:
vlq "^0.2.1"
magic-string@^0.22.3:
version "0.22.4"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.4.tgz#31039b4e40366395618c1d6cf8193c53917475ff"
dependencies:
vlq "^0.2.1"
make-error@^1.1.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.0.tgz#52ad3a339ccf10ce62b4040b708fe707244b8b96"
@ -4241,6 +4286,12 @@ opn@4.0.2:
object-assign "^4.0.1"
pinkie-promise "^2.0.0"
opn@~5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/opn/-/opn-5.1.0.tgz#72ce2306a17dbea58ff1041853352b4a8fc77519"
dependencies:
is-wsl "^1.1.0"
optimist@0.6.x, optimist@^0.6.1, optimist@~0.6.0:
version "0.6.1"
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
@ -5112,18 +5163,18 @@ request-progress@~2.0.1:
dependencies:
throttleit "^1.0.0"
request@2, request@^2.72.0, request@^2.78.0, request@^2.79.0, request@~2.79.0:
version "2.79.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
request@2, request@^2.72.0, request@^2.79.0, request@^2.81.0:
version "2.81.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
dependencies:
aws-sign2 "~0.6.0"
aws4 "^1.2.1"
caseless "~0.11.0"
caseless "~0.12.0"
combined-stream "~1.0.5"
extend "~3.0.0"
forever-agent "~0.6.1"
form-data "~2.1.1"
har-validator "~2.0.6"
har-validator "~4.2.1"
hawk "~3.1.3"
http-signature "~1.1.0"
is-typedarray "~1.0.0"
@ -5131,10 +5182,12 @@ request@2, request@^2.72.0, request@^2.78.0, request@^2.79.0, request@~2.79.0:
json-stringify-safe "~5.0.1"
mime-types "~2.1.7"
oauth-sign "~0.8.1"
qs "~6.3.0"
performance-now "^0.2.0"
qs "~6.4.0"
safe-buffer "^5.0.1"
stringstream "~0.0.4"
tough-cookie "~2.3.0"
tunnel-agent "~0.4.1"
tunnel-agent "^0.6.0"
uuid "^3.0.0"
request@2.78.0:
@ -5162,18 +5215,18 @@ request@2.78.0:
tough-cookie "~2.3.0"
tunnel-agent "~0.4.1"
request@^2.81.0:
version "2.81.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
request@^2.78.0, request@~2.79.0:
version "2.79.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
dependencies:
aws-sign2 "~0.6.0"
aws4 "^1.2.1"
caseless "~0.12.0"
caseless "~0.11.0"
combined-stream "~1.0.5"
extend "~3.0.0"
forever-agent "~0.6.1"
form-data "~2.1.1"
har-validator "~4.2.1"
har-validator "~2.0.6"
hawk "~3.1.3"
http-signature "~1.1.0"
is-typedarray "~1.0.0"
@ -5181,12 +5234,10 @@ request@^2.81.0:
json-stringify-safe "~5.0.1"
mime-types "~2.1.7"
oauth-sign "~0.8.1"
performance-now "^0.2.0"
qs "~6.4.0"
safe-buffer "^5.0.1"
qs "~6.3.0"
stringstream "~0.0.4"
tough-cookie "~2.3.0"
tunnel-agent "^0.6.0"
tunnel-agent "~0.4.1"
uuid "^3.0.0"
require-directory@^2.1.1:
@ -5696,7 +5747,7 @@ source-map-loader@^0.2.0:
loader-utils "~0.2.2"
source-map "~0.1.33"
source-map-support@^0.4.0, source-map-support@^0.4.15, source-map-support@^0.4.2, source-map-support@~0.4.0:
source-map-support@^0.4.0, source-map-support@^0.4.1, source-map-support@^0.4.15, source-map-support@^0.4.2, source-map-support@~0.4.0:
version "0.4.15"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1"
dependencies:
@ -5919,6 +5970,12 @@ supports-color@^3.1.0, supports-color@^3.1.1, supports-color@^3.2.3:
dependencies:
has-flag "^1.0.0"
supports-color@^4.0.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.1.tgz#65a4bb2631e90e02420dba5554c375a4754bb836"
dependencies:
has-flag "^2.0.0"
svgo@^0.7.0:
version "0.7.2"
resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5"
@ -6750,6 +6807,10 @@ yn@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a"
zone.js@^0.8.14:
version "0.8.16"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.16.tgz#ac31b6c418f88c0f918ad6acd8a402aca9313abb"
zone.js@^0.8.4:
version "0.8.12"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.12.tgz#86ff5053c98aec291a0bf4bbac501d694a05cfbb"

View File

@ -40,6 +40,16 @@ if [[ ${CI_MODE:-} == "aio" ]]; then
exit 0;
fi
# Build the Angular packages then exit (no further build required)
if [[ ${CI_MODE:-} == "aio_e2e" ]]; then
travisFoldStart "build.aio_e2e"
(
./build.sh
)
travisFoldEnd "build.aio_e2e"
exit 0;
fi
travisFoldStart "tsc tools"
$(npm bin)/tsc -p tools
$(npm bin)/tsc -p packages/tsc-wrapped/tsconfig-build.json

View File

@ -18,6 +18,12 @@ source ${thisDir}/_travis-fold.sh
travisFoldEnd "test.aio.lint"
# Run unit tests for boilerplate tools
travisFoldStart "test.aio.boilerplate.unit"
yarn boilerplate:test
travisFoldEnd "test.aio.boilerplate.unit"
# Run unit tests
travisFoldStart "test.aio.unit"
yarn test -- --single-run
@ -29,11 +35,13 @@ source ${thisDir}/_travis-fold.sh
yarn e2e
travisFoldEnd "test.aio.e2e"
# Run PWA-score tests
travisFoldStart "test.aio.pwaScore"
yarn test-pwa-score-local
travisFoldEnd "test.aio.pwaScore"
# Run unit tests for aio/aio-builds-setup
travisFoldStart "test.aio.aio-builds-setup"
./aio-builds-setup/scripts/test.sh