1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-08 23:25:51 +01:00

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
This commit is contained in:
Juan Picado 2020-10-09 09:53:44 -07:00 committed by GitHub
parent 22b85de14d
commit 401c987e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 163 additions and 16 deletions

@ -9,7 +9,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
node_version: [8, 10, 12, 13] node_version: [8, 10, 12, 13, 14]
runs-on: ubuntu-latest runs-on: ubuntu-latest

@ -48,17 +48,17 @@ jobs:
steps: steps:
- uses: actions/checkout@v2.3.3 - 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 uses: actions/setup-node@v2.1.1
with: with:
node-version: 10.x node-version: 14.x
- name: 'install latest npm' - name: 'install latest npm'
run: npm i -g npm run: npm i -g npm
- name: Install Dependencies - name: Install Dependencies
run: yarn install --pure-lockfile run: yarn install --pure-lockfile
- name: 'Run verdaccio in the background' - name: 'Run verdaccio in the background'
run: | run: |
nohup node ./scripts/run-verdaccio.js & nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml &
- name: 'Ping to verdaccio' - name: 'Ping to verdaccio'
run: | run: |
npm ping --registry http://localhost:4873 npm ping --registry http://localhost:4873
@ -78,6 +78,43 @@ jobs:
npm install @angular-devkit/core@next @babel/preset-env @babel/core -D npm install @angular-devkit/core@next @babel/preset-env @babel/core -D
npm run ng build --aot 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 throws errors worth to check why
# pnpm: # pnpm:

@ -14,30 +14,31 @@ jobs:
steps: steps:
- uses: actions/checkout@v2.3.3 - 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 uses: actions/setup-node@v2.1.1
with: with:
node-version: 10.x node-version: 14.x
- name: 'install latest npm' - name: 'install latest npm'
run: npm i -g npm run: npm i -g npm
- name: Install Dependencies - name: Install Dependencies
run: yarn install --pure-lockfile run: yarn install --pure-lockfile
- name: 'Run verdaccio in the background' - name: 'Run verdaccio in the background'
run: | run: |
nohup node ./scripts/run-verdaccio.js & nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml &
- name: 'Ping to verdaccio' - name: 'Ping to verdaccio'
run: | run: |
npm ping --registry http://localhost:4873 npm ping --registry http://localhost:4873
- name: 'Running the integration test' - name: 'Running the integration test'
run: | run: |
source scripts/e2e-setup-ci.sh source scripts/e2e-setup-ci.sh
echo "registry=http://localhost:4873" > ~/.npmrc echo "registry=http://localhost:4873
npm config set loglevel="http" loglevel="silent"
npm config set fetch-retries="5" fetch-retries=10
npm config set fetch-retry-factor="50" fetch-retry-factor=2
npm config set fetch-retry-mintimeout="20000" fetch-retry-mintimeout=10000
npm config set fetch-retry-maxtimeout="80000" fetch-retry-maxtimeout=80000" > ~/.npmrc
npm config list
npm i -g gatsby npm i -g gatsby
gatsby new my-gatsby --verbose gatsby new my-gatsby
cd my-gatsby cd my-gatsby
npm run build npm run build

@ -22,7 +22,7 @@ jobs:
run: yarn install --pure-lockfile run: yarn install --pure-lockfile
- name: 'Run verdaccio in the background' - name: 'Run verdaccio in the background'
run: | run: |
nohup node ./scripts/run-verdaccio.js & nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml &
- name: 'Ping to verdaccio' - name: 'Ping to verdaccio'
run: | run: |
npm ping --registry http://localhost:4873 npm ping --registry http://localhost:4873
@ -38,6 +38,40 @@ jobs:
yarn add left-pad --registry http://localhost:4873 --verbose 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 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 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: npm:
name: 'npm:jest example' name: 'npm:jest example'
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -55,7 +89,7 @@ jobs:
run: yarn install --pure-lockfile run: yarn install --pure-lockfile
- name: 'Run verdaccio in the background' - name: 'Run verdaccio in the background'
run: | run: |
nohup node ./scripts/run-verdaccio.js & nohup node ./scripts/run-verdaccio.js --config ./scripts/e2e-config.yaml &
- name: 'Ping to verdaccio' - name: 'Ping to verdaccio'
run: | run: |
npm ping --registry http://localhost:4873 npm ping --registry http://localhost:4873
@ -71,6 +105,40 @@ jobs:
yarn add left-pad --registry http://localhost:4873 --verbose 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 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 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: pnpm:
name: 'pnpm:jest example' name: 'pnpm:jest example'
runs-on: ubuntu-latest runs-on: ubuntu-latest

1
.npmrc

@ -1 +1,2 @@
always-auth = true always-auth = true
fetch-retries="10"

40
scripts/e2e-config.yaml Normal file

@ -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 }