Skip to content

Commit

Permalink
chore: fix e2e yarn berry tests (#5342)
Browse files Browse the repository at this point in the history
* disable pnp

* test-release support --skip-install + revert to pnp mode

* fix yarn canary?

* add YARN_ENABLE_IMMUTABLE_INSTALLS env

* add nodeLinker matrix

* Update .github/workflows/v2-tests-e2e.yml

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>

* polish e2e test workflows

* polish e2e test workflows

* set npm_config_registry

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
  • Loading branch information
slorber and merceyz committed Aug 12, 2021
1 parent 1f8fa5e commit ac4a253
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 15 deletions.
44 changes: 31 additions & 13 deletions .github/workflows/v2-tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,32 @@ jobs:
uses: bahmutov/npm-install@v1
with:
install-command: yarn
- name: Setup test-website project against master release
- name: Generate test-website project against master release
run: |
yarn test:build:v2
rm -rf node_modules
KEEP_CONTAINER=true yarn test:build:v2 -s
mv test-website ../test-website
- name: Install test-website project with Yarn v1
run: |
cd ../test-website
yarn install
env:
npm_config_registry: http://localhost:4873
- name: Start test-website project
run: cd test-website && yarn start --no-open
run: cd ../test-website && yarn start --no-open
env:
E2E_TEST: true
- name: Build test-website project
run: cd test-website && yarn build
run: cd ../test-website && yarn build
env:
CI: true
yarn-v2:

yarn-berry:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
node: ['14']
nodeLinker: ['pnp', 'node-modules']
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
Expand All @@ -57,24 +65,34 @@ jobs:
uses: bahmutov/npm-install@v1
with:
install-command: yarn
- name: Setup test-website project against master release

- name: Generate test-website project against master release
run: |
KEEP_CONTAINER=true yarn test:build:v2
rm -rf node_modules
- name: Setup test-website project for Yarn v2
KEEP_CONTAINER=true yarn test:build:v2 -s
mv test-website ../test-website
- name: Install test-website project with Yarn Berry and nodeLinker = ${{ matrix.nodeLinker }}
run: |
cd test-website
cd ../test-website
# we have to switch to berry first before setting the version we want
yarn set version berry
# temporary using canary for #5342
yarn set version canary
yarn config set nodeLinker ${{ matrix.nodeLinker }}
yarn config set pnpMode loose
yarn config set npmRegistryServer http://localhost:4873
yarn config set unsafeHttpWhitelist --json '["localhost"]'
yarn config set enableGlobalCache true
yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false # Yarn berry should create the lockfile, despite CI env
- name: Start test-website project
run: cd test-website && yarn start --no-open
run: cd ../test-website && yarn start --no-open
env:
E2E_TEST: true
- name: Build test-website project
run: cd test-website && yarn build
run: cd ../test-website && yarn build
env:
CI: true
23 changes: 21 additions & 2 deletions admin/scripts/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,27 @@ NEW_VERSION="$(node -p "require('./packages/docusaurus/package.json').version").
CONTAINER_NAME="verdaccio"
EXTRA_OPTS=""

if getopts ":n" arg; then
EXTRA_OPTS="--use-npm"
usage() { echo "Usage: $0 [-n] [-s]" 1>&2; exit 1; }

while getopts ":ns" o; do
case "${o}" in
n)
EXTRA_OPTS="--use-npm"
;;
s)
EXTRA_OPTS="--skip-install"
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))


if [ ! -z $EXTRA_OPTS ]
then
echo docusaurus-init extra options = ${EXTRA_OPTS}
fi

# Run Docker container with private npm registry Verdaccio
Expand Down

0 comments on commit ac4a253

Please sign in to comment.