0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05: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

View file

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

View file

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

View file

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

View file

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

1
.npmrc
View file

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

40
scripts/e2e-config.yaml Normal file
View 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 }