From 401c987e183ba628c4540e0569c13b0e265836fd Mon Sep 17 00:00:00 2001 From: Juan Picado Date: Fri, 9 Oct 2020 09:53:44 -0700 Subject: [PATCH] test: add yarn berry and npm7 to and new e2e config file (#1960) * test: add e2e config file * test: add e2e config file * chore: add yarn berry to e2e * chore: add npm7 to e2e * chore: add node 14 to ci --- .github/workflows/ci.yml | 2 +- .../workflows/e2e-angular-cli-workflow.yml | 43 ++++++++++- .../workflows/e2e-gatsbyjs-cli-workflow.yml | 21 +++--- .github/workflows/e2e-jest-workflow.yml | 72 ++++++++++++++++++- .npmrc | 1 + scripts/e2e-config.yaml | 40 +++++++++++ 6 files changed, 163 insertions(+), 16 deletions(-) create mode 100644 scripts/e2e-config.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c75658258..a919064d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - node_version: [8, 10, 12, 13] + node_version: [8, 10, 12, 13, 14] runs-on: ubuntu-latest diff --git a/.github/workflows/e2e-angular-cli-workflow.yml b/.github/workflows/e2e-angular-cli-workflow.yml index e3401c5e7..772f9cd92 100644 --- a/.github/workflows/e2e-angular-cli-workflow.yml +++ b/.github/workflows/e2e-angular-cli-workflow.yml @@ -48,17 +48,17 @@ jobs: steps: - uses: actions/checkout@v2.3.3 - - name: 'Use Node.js 10.x' + - name: 'Use Node.js 14.x' uses: actions/setup-node@v2.1.1 with: - node-version: 10.x + node-version: 14.x - name: 'install latest npm' run: npm i -g npm - name: Install Dependencies run: yarn install --pure-lockfile - name: 'Run verdaccio in the background' run: | - nohup node ./scripts/run-verdaccio.js & + nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & - name: 'Ping to verdaccio' run: | npm ping --registry http://localhost:4873 @@ -78,6 +78,43 @@ jobs: npm install @angular-devkit/core@next @babel/preset-env @babel/core -D npm run ng build --aot + npm7: + name: 'npm7:angular example' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2.3.3 + + - name: 'Use Node.js 14.x' + uses: actions/setup-node@v2.1.1 + with: + node-version: 14.x + - name: 'install latest npm' + run: npm i -g npm@next-7 + - name: Install Dependencies + run: yarn install --pure-lockfile + - name: 'Run verdaccio in the background' + run: | + nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & + - name: 'Ping to verdaccio' + run: | + npm ping --registry http://localhost:4873 + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + echo "registry=http://localhost:4873" > ~/.npmrc + npm config set loglevel="silent" + npm config set fetch-retries="5" + npm config set fetch-retry-factor="50" + npm config set fetch-retry-mintimeout="20000" + npm config set fetch-retry-maxtimeout="80000" + npm install -g @angular/cli + ng new verdaccio-angular --interactive=false + + cd verdaccio-angular + npm install @angular-devkit/core@next @babel/preset-env @babel/core -D + + npm run ng build --aot # pnpm throws errors worth to check why # pnpm: diff --git a/.github/workflows/e2e-gatsbyjs-cli-workflow.yml b/.github/workflows/e2e-gatsbyjs-cli-workflow.yml index b91b12afa..029444549 100644 --- a/.github/workflows/e2e-gatsbyjs-cli-workflow.yml +++ b/.github/workflows/e2e-gatsbyjs-cli-workflow.yml @@ -14,30 +14,31 @@ jobs: steps: - uses: actions/checkout@v2.3.3 - - name: 'Use Node.js 10.x' + - name: 'Use Node.js 14.x' uses: actions/setup-node@v2.1.1 with: - node-version: 10.x + node-version: 14.x - name: 'install latest npm' run: npm i -g npm - name: Install Dependencies run: yarn install --pure-lockfile - name: 'Run verdaccio in the background' run: | - nohup node ./scripts/run-verdaccio.js & + nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & - name: 'Ping to verdaccio' run: | npm ping --registry http://localhost:4873 - name: 'Running the integration test' run: | source scripts/e2e-setup-ci.sh - echo "registry=http://localhost:4873" > ~/.npmrc - npm config set loglevel="http" - npm config set fetch-retries="5" - npm config set fetch-retry-factor="50" - npm config set fetch-retry-mintimeout="20000" - npm config set fetch-retry-maxtimeout="80000" + echo "registry=http://localhost:4873 + loglevel="silent" + fetch-retries=10 + fetch-retry-factor=2 + fetch-retry-mintimeout=10000 + fetch-retry-maxtimeout=80000" > ~/.npmrc + npm config list npm i -g gatsby - gatsby new my-gatsby --verbose + gatsby new my-gatsby cd my-gatsby npm run build diff --git a/.github/workflows/e2e-jest-workflow.yml b/.github/workflows/e2e-jest-workflow.yml index b4a93d577..114c79ee9 100644 --- a/.github/workflows/e2e-jest-workflow.yml +++ b/.github/workflows/e2e-jest-workflow.yml @@ -22,7 +22,7 @@ jobs: run: yarn install --pure-lockfile - name: 'Run verdaccio in the background' run: | - nohup node ./scripts/run-verdaccio.js & + nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & - name: 'Ping to verdaccio' run: | npm ping --registry http://localhost:4873 @@ -38,6 +38,40 @@ jobs: yarn add left-pad --registry http://localhost:4873 --verbose echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js yarn jest module.test.js + yarn2: + name: 'yarn2:jest example' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2.3.3 + + - name: 'Use Node.js 10.x' + uses: actions/setup-node@v2.1.1 + with: + node-version: 10.x + - name: Install Dependencies + run: yarn install --pure-lockfile + - name: 'Run verdaccio in the background' + run: | + nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & + - name: 'Ping to verdaccio' + run: | + npm ping --registry http://localhost:4873 + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + yarn init --yes + yarn set version berry + yarn config set npmRegistryServer "http://localhost:4873" + yarn config set unsafeHttpWhitelist --json '["localhost"]' + yarn add jest + + echo "it('should pass', () => { expect(true).toBeTruthy(); });" | tee pass.test.js + yarn jest pass.test.js + + yarn add left-pad + echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js + yarn jest module.test.js npm: name: 'npm:jest example' runs-on: ubuntu-latest @@ -55,7 +89,7 @@ jobs: run: yarn install --pure-lockfile - name: 'Run verdaccio in the background' run: | - nohup node ./scripts/run-verdaccio.js & + nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & - name: 'Ping to verdaccio' run: | npm ping --registry http://localhost:4873 @@ -71,6 +105,40 @@ jobs: yarn add left-pad --registry http://localhost:4873 --verbose echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js yarn jest module.test.js + npm7: + name: 'npm7:jest example' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2.3.3 + + - name: 'Use Node.js 10.x' + uses: actions/setup-node@v2.1.1 + with: + node-version: 10.x + - name: 'install latest npm' + run: npm i -g npm@next-7 + - name: Install Dependencies + run: yarn install --pure-lockfile + - name: 'Run verdaccio in the background' + run: | + nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml & + - name: 'Ping to verdaccio' + run: | + npm ping --registry http://localhost:4873 + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + npm init --force + npm install jest --registry http://localhost:4873 + + echo "it('should pass', () => { expect(true).toBeTruthy(); });" | tee pass.test.js + yarn jest pass.test.js + + yarn add left-pad --registry http://localhost:4873 --verbose + echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" | tee module.test.js + yarn jest module.test.js + pnpm: name: 'pnpm:jest example' runs-on: ubuntu-latest diff --git a/.npmrc b/.npmrc index 45bbe77bc..25bc24754 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ always-auth = true +fetch-retries="10" diff --git a/scripts/e2e-config.yaml b/scripts/e2e-config.yaml new file mode 100644 index 000000000..070a9b1b3 --- /dev/null +++ b/scripts/e2e-config.yaml @@ -0,0 +1,40 @@ +storage: ./storage +plugins: ./plugins + +web: + title: Verdaccio e2e +auth: + htpasswd: + file: ./htpasswd +uplinks: + verdaccio: + url: https://registry.verdaccio.org/ + max_fails: 30 + fail_timeout: 10m + timeout: 60s + cache: false + maxage: 30m + +packages: + '@*/*': + # scoped packages + access: $all + publish: $authenticated + unpublish: $authenticated + proxy: verdaccio + + '**': + access: $all + publish: $authenticated + unpublish: $authenticated + proxy: verdaccio + +server: + keepAliveTimeout: 60 + +middlewares: + audit: + enabled: true + +logs: + - { type: stdout, format: pretty, level: warn }