Skip to content

Commit

Permalink
test(bazel): Upgrade CLI dependencies for schematics test
Browse files Browse the repository at this point in the history
This commit makes the integration test for bazel-schematics more robust
by removing package.json.replace. Instead of replacing the file, the
test script now just overrides Angular packages with the local ones.

This commit also fixes running the test locally by providing default
argument for CI_CHROMEDRIVER_VERSION_ARG.
  • Loading branch information
kyliau committed Feb 20, 2019
1 parent 04ae125 commit 7eb712f
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 307 deletions.
55 changes: 0 additions & 55 deletions integration/bazel-schematics/package.json.replace

This file was deleted.

21 changes: 15 additions & 6 deletions integration/bazel-schematics/test.sh
@@ -1,7 +1,19 @@
#!/usr/bin/env bash

set -eux -o pipefail
readonly pwd=$(pwd)

function installLocalPackages() {
readonly pwd=$(pwd)
readonly packages=(
animations common compiler core forms platform-browser
platform-browser-dynamic router bazel compiler-cli language-service upgrade
)
local local_packages=()
for package in "${packages[@]}"; do
local_packages+=("@angular/${package}@file:${pwd}/../../../dist/packages-dist/${package}")
done
yarn add "${local_packages[@]}"
}

function testBazel() {
# Set up
Expand All @@ -11,10 +23,8 @@ function testBazel() {
# Create project
ng new demo --collection=@angular/bazel --defaults --skip-git --skip-install --style=scss
cd demo
cp ../package.json.replace ./package.json
sed -i "s#file:../angular#${pwd}/../..#" ./package.json
yarn
yarn webdriver-manager update --gecko=false --standalone=false $CI_CHROMEDRIVER_VERSION_ARG
installLocalPackages
yarn webdriver-manager update --gecko=false --standalone=false ${CI_CHROMEDRIVER_VERSION_ARG:---versions.chrome 2.45}
ng generate component widget --style=css
ng build
ng test
Expand All @@ -26,7 +36,6 @@ function testNonBazel() {
mv ./angular.json.bak ./angular.json
mv ./tsconfig.json.bak ./tsconfig.json
rm -rf dist src/main.dev.ts src/main.prod.ts
sed -i 's/"es5BrowserSupport": true//' angular.json
ng build --progress=false
ng test --progress=false --watch=false
ng e2e --configuration=production --webdriver-update=false
Expand Down

0 comments on commit 7eb712f

Please sign in to comment.