Skip to content

Commit

Permalink
ci(e2e): force pnp e2e tests to run with pnp linker (#2991)
Browse files Browse the repository at this point in the history
* ci(e2e): force pnp e2e tests to run with pnp linker

* ci(e2e): print which linker is used

* ci(e2e): set some settings earlier

* ci: set nodeLinker in config
  • Loading branch information
paul-soporan authored Jul 6, 2021
1 parent c810691 commit 3972f96
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/e2e-nm-angular-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ jobs:

- name: 'Running the integration test'
run: |
source scripts/e2e-setup-ci.sh;
source scripts/e2e-setup-ci.sh nm
yarn dlx -p @angular/cli@next ng new berry-angular --interactive=false
cd berry-angular
echo 'nodeLinker: node-modules' >> .yarnrc.yml
echo 'enableGlobalCache: true' >> .yarnrc.yml
echo 'compressionLevel: 0' >> .yarnrc.yml
yarn add @angular-devkit/core@next @babel/preset-env @babel/core -D
yarn ng build --aot
shell: bash
env:
YARN_ENABLE_GLOBAL_CACHE: true
YARN_COMPRESSION_LEVEL: 0
4 changes: 2 additions & 2 deletions .github/workflows/e2e-nm-babel-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:

- name: 'Running node_modules install with self-validation'
run: |
source scripts/e2e-setup-ci.sh
source scripts/e2e-setup-ci.sh nm
git clone https://github.com/babel/babel.git
cd babel
NM_DEBUG_LEVEL=1 YARN_NODE_LINKER=node-modules yarn
NM_DEBUG_LEVEL=1 yarn
shell: bash
4 changes: 2 additions & 2 deletions .github/workflows/e2e-nm-berry-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: 'Running node_modules install with self-validation'
run: |
source scripts/e2e-setup-ci.sh
source scripts/e2e-setup-ci.sh nm
cd -
NM_DEBUG_LEVEL=1 YARN_NODE_LINKER=node-modules yarn
NM_DEBUG_LEVEL=1 yarn
shell: bash
13 changes: 13 additions & 0 deletions scripts/e2e-setup-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ git config --global user.name "John Doe"

# We want all e2e tests to fail on unhandled rejections
export NODE_OPTIONS="--unhandled-rejections=strict"

if [[ "$1" == "nm" ]]; then
NODE_LINKER="node-modules"
elif [[ -z "$1" || "$1" == "pnp" ]]; then
NODE_LINKER="pnp"
else
echo "Invalid nodeLinker: $1"
exit 1
fi

yarn config set -H nodeLinker "$NODE_LINKER"

echo nodeLinker: $NODE_LINKER

0 comments on commit 3972f96

Please sign in to comment.