build: fix integration tests flakes using local yarn cache for bazel-schematics & ng_elements_schematics demos (#35877)
ng_update_migrations will still access the global yarn cache on its `ng update` call and there is no way to avoid this that I can see but if no other integration tests access the global yarn cache then that one test can have free reign over it. PR Close #35877
This commit is contained in:
parent
de67978a7d
commit
a1d0396c55
|
@ -38,7 +38,7 @@ function installLocalPackages() {
|
||||||
local_packages+=("puppeteer@file:${pwd}/../node_modules/puppeteer")
|
local_packages+=("puppeteer@file:${pwd}/../node_modules/puppeteer")
|
||||||
local_packages+=("webdriver-manager@file:${pwd}/../node_modules/webdriver-manager")
|
local_packages+=("webdriver-manager@file:${pwd}/../node_modules/webdriver-manager")
|
||||||
|
|
||||||
yarn add --ignore-scripts --silent "${local_packages[@]}"
|
yarn add --ignore-scripts --silent "${local_packages[@]}" --cache-folder ./.yarn_local_cache
|
||||||
}
|
}
|
||||||
|
|
||||||
function patchKarmaConf() {
|
function patchKarmaConf() {
|
||||||
|
@ -58,6 +58,8 @@ function testBazel() {
|
||||||
# Create project
|
# Create project
|
||||||
ng new demo --collection=@angular/bazel --routing --skip-git --skip-install --style=scss
|
ng new demo --collection=@angular/bazel --routing --skip-git --skip-install --style=scss
|
||||||
cd demo
|
cd demo
|
||||||
|
# Use a local yarn cache folder so we don't access the global yarn cache
|
||||||
|
mkdir .yarn_local_cache
|
||||||
patchKarmaConf
|
patchKarmaConf
|
||||||
patchProtractorConf
|
patchProtractorConf
|
||||||
installLocalPackages
|
installLocalPackages
|
||||||
|
@ -79,7 +81,7 @@ function testNonBazel() {
|
||||||
# disable CLI's version check (if version is 0.0.0, then no version check happens)
|
# disable CLI's version check (if version is 0.0.0, then no version check happens)
|
||||||
yarn --cwd node_modules/@angular/cli version --new-version 0.0.0 --no-git-tag-version
|
yarn --cwd node_modules/@angular/cli version --new-version 0.0.0 --no-git-tag-version
|
||||||
# re-add build-angular
|
# re-add build-angular
|
||||||
yarn add --dev file:../node_modules/@angular-devkit/build-angular
|
yarn add --dev file:../node_modules/@angular-devkit/build-angular --cache-folder ./.yarn_local_cache
|
||||||
ng build --progress=false
|
ng build --progress=false
|
||||||
ng test --progress=false --watch=false
|
ng test --progress=false --watch=false
|
||||||
ng e2e --port 0 --configuration=production --webdriver-update=false
|
ng e2e --port 0 --configuration=production --webdriver-update=false
|
||||||
|
|
|
@ -53,11 +53,13 @@ rm('-rf', `demo`);
|
||||||
exec('ng version');
|
exec('ng version');
|
||||||
exec('ng new demo --skip-git --skip-install --style=css --no-interactive');
|
exec('ng new demo --skip-git --skip-install --style=css --no-interactive');
|
||||||
cd('demo');
|
cd('demo');
|
||||||
|
// Use a local yarn cache folder so we don't access the global yarn cache
|
||||||
|
exec('mkdir .yarn_local_cache');
|
||||||
|
|
||||||
// Install Angular packages that are built locally from HEAD and npm packages
|
// Install Angular packages that are built locally from HEAD and npm packages
|
||||||
// from root node modules that are to be kept in sync
|
// from root node modules that are to be kept in sync
|
||||||
const packageList = Object.keys(packages).map(p => `${p}@${packages[p]}`).join(' ');
|
const packageList = Object.keys(packages).map(p => `${p}@${packages[p]}`).join(' ');
|
||||||
exec(`yarn add --ignore-scripts --silent ${packageList}`);
|
exec(`yarn add --ignore-scripts --silent ${packageList} --cache-folder ./.yarn_local_cache`);
|
||||||
|
|
||||||
// Add @angular/elements
|
// Add @angular/elements
|
||||||
exec(bazelMappings ? `ng add "${bazelMappings['@angular/elements']}"` : `ng add "${__dirname}/../../dist/packages-dist/elements"`);
|
exec(bazelMappings ? `ng add "${bazelMappings['@angular/elements']}"` : `ng add "${__dirname}/../../dist/packages-dist/elements"`);
|
||||||
|
|
Loading…
Reference in New Issue