mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
build: e2e acceptance tests (#1846)
* chore: test e2e * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: update name * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: this should fails * chore: restore config
This commit is contained in:
parent
b5028f2d8a
commit
99dc8510fc
5 changed files with 288 additions and 0 deletions
116
.github/workflows/e2e-angular-cli-workflow.yml
vendored
Normal file
116
.github/workflows/e2e-angular-cli-workflow.yml
vendored
Normal file
|
@ -0,0 +1,116 @@
|
|||
on:
|
||||
schedule:
|
||||
- cron: '0 3 * * 5'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
name: 'E2E Angular CLI with verdaccio'
|
||||
jobs:
|
||||
# todo: fix yarn global issue, cannot find ng
|
||||
# yarn:
|
||||
# name: 'yarn:angular example'
|
||||
# runs-on: ubuntu-latest
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@master
|
||||
#
|
||||
# - name: 'Use Node.js 10.x'
|
||||
# uses: actions/setup-node@master
|
||||
# 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 &
|
||||
# - 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 global add @angular/cli
|
||||
# which nodemon
|
||||
# ng new verdaccio-angular --interactive=false
|
||||
#
|
||||
# cd verdaccio-angular
|
||||
# echo "registry=http://localhost:4873" > ~/.npmrc
|
||||
# yarn add @angular-devkit/core@next @babel/preset-env @babel/core -D
|
||||
#
|
||||
# ng build --aot
|
||||
npm:
|
||||
name: 'npm:angular example'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: 'Use Node.js 10.x'
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 10.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 &
|
||||
- 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"
|
||||
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:
|
||||
# name: 'pnpm:angular example'
|
||||
# runs-on: ubuntu-latest
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@master
|
||||
#
|
||||
# - name: 'Use Node.js 10.x'
|
||||
# uses: actions/setup-node@master
|
||||
# with:
|
||||
# node-version: 10.x
|
||||
# - name: 'install latest pnpm'
|
||||
# run: npm i -g pnpm
|
||||
# - name: Install Dependencies
|
||||
# run: yarn install --pure-lockfile
|
||||
# - name: 'Run verdaccio in the background'
|
||||
# run: |
|
||||
# nohup node ./scripts/run-verdaccio.js &
|
||||
# - name: 'Ping to verdaccio'
|
||||
# run: |
|
||||
# pnpm ping --registry http://localhost:4873
|
||||
# - name: 'Running the integration test'
|
||||
# run: |
|
||||
# source scripts/e2e-setup-ci.sh
|
||||
# pnpm init --force
|
||||
#
|
||||
# pnpm install -g @angular/cli
|
||||
# ng new verdaccio-angular --interactive=false
|
||||
#
|
||||
# cd verdaccio-angular
|
||||
# echo "registry=http://localhost:4873" > ~/.npmrc
|
||||
# pnpm install @angular-devkit/core@next @babel/preset-env @babel/core -D
|
||||
#
|
||||
# pnpm run ng build --aot
|
43
.github/workflows/e2e-gatsbyjs-cli-workflow.yml
vendored
Normal file
43
.github/workflows/e2e-gatsbyjs-cli-workflow.yml
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
on:
|
||||
schedule:
|
||||
- cron: '0 3 * * 5'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
name: 'E2E Gatsby.js CLI with verdaccio'
|
||||
jobs:
|
||||
npm:
|
||||
name: 'npm:gatsby example'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: 'Use Node.js 10.x'
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 10.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 &
|
||||
- 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"
|
||||
npm i -g gatsby
|
||||
gatsby new my-gatsby --verbose
|
||||
cd my-gatsby
|
||||
npm run build
|
107
.github/workflows/e2e-jest-workflow.yml
vendored
Normal file
107
.github/workflows/e2e-jest-workflow.yml
vendored
Normal file
|
@ -0,0 +1,107 @@
|
|||
on:
|
||||
schedule:
|
||||
- cron: '0 3 * * 5'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
name: 'E2E Jest with verdaccio'
|
||||
jobs:
|
||||
yarn:
|
||||
name: 'yarn:jest example'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: 'Use Node.js 10.x'
|
||||
uses: actions/setup-node@master
|
||||
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 &
|
||||
- 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 add 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
|
||||
npm:
|
||||
name: 'npm:jest example'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: 'Use Node.js 10.x'
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 10.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 &
|
||||
- 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
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: 'Use Node.js 10.x'
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 10.x
|
||||
- name: 'install latest pnpm'
|
||||
run: npm i -g pnpm
|
||||
- name: Install Dependencies
|
||||
run: yarn install --pure-lockfile
|
||||
- name: 'Run verdaccio in the background'
|
||||
run: |
|
||||
nohup node ./scripts/run-verdaccio.js &
|
||||
- name: 'Ping to verdaccio'
|
||||
run: |
|
||||
pnpm ping --registry http://localhost:4873
|
||||
- name: 'Running the integration test'
|
||||
run: |
|
||||
source scripts/e2e-setup-ci.sh
|
||||
pnpm init --force
|
||||
pnpm 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
|
||||
|
14
scripts/e2e-setup-ci.sh
Normal file
14
scripts/e2e-setup-ci.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
HERE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
TEMP_DIR="$(mktemp -d)"
|
||||
|
||||
cd "${TEMP_DIR}"
|
||||
|
||||
echo $TEMP_DIR
|
||||
echo $HERE_DIR
|
||||
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "John Doe"
|
8
scripts/run-verdaccio.js
Normal file
8
scripts/run-verdaccio.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// this file aims to help local debugging with hot transpilation
|
||||
// it requires BABEL_ENV=registry set as env variable
|
||||
require('@babel/register')({
|
||||
extensions: [".ts", ".js"]
|
||||
});
|
||||
require('../src/lib/cli');
|
Loading…
Reference in a new issue