Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test e2e2 #1

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ jobs:
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('yarn.lock') }}

- name: Install
run: yarn install
- uses: actions/download-artifact@v2
Expand Down Expand Up @@ -264,3 +265,61 @@ jobs:
run: make test-flow
- name: Run TypeScript Tests
run: make test-typescript

e2e-publish:
name: Publish to local Verdaccio registry (juan test)
needs: prepare-yarn-cache
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js latest
uses: actions/setup-node@v2-beta
with:
node-version: "15"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
/tmp/verdaccio-workspace
key: |
yarn-${{ hashFiles('yarn.lock') }}
ver-${{ hashFiles('yarn.lock') }}
- name: Publish
run: ./scripts/integration-tests/publish-local.sh
- uses: actions/upload-artifact@v2
with:
name: verdaccio-workspace
path: /tmp/verdaccio-workspace

- name: Display structure of downloaded files
run: ls -R
- name: Display workspace
run: ls -R /tmp/verdaccio-workspace

e2e-create-react-app:
name: E2E - create-react-app
needs: e2e-publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js latest
uses: actions/setup-node@v2-beta
with:
node-version: "*"
- uses: actions/download-artifact@v2
with:
name: verdaccio-workspace
path: /tmp/verdaccio-workspace
- name: Display structure of downloaded files
run: ls -R
- name: Display workspace
run: ls -R /tmp/verdaccio-workspace
- name: Test
run: ./scripts/integration-tests/e2e-create-react-app.sh
2 changes: 1 addition & 1 deletion scripts/integration-tests/e2e-create-react-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ done
export YARN_IGNORE_PATH=1

startLocalRegistry "$PWD"/../../verdaccio-config.yml
yarn install
yarn install --verbose --registry http://localhost:4873

# Test
CI=true yarn test
Expand Down
5 changes: 3 additions & 2 deletions scripts/integration-tests/utils/local-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
# Copied from https://github.com/facebook/create-react-app/blob/053f9774d3f592c17741d2a86de66a7ca58f90c0/tasks/local-registry.sh

custom_registry_url=http://localhost:4873
default_verdaccio_package=verdaccio@~4.3.3
default_verdaccio_package=verdaccio@~4.10.0

function startLocalRegistry {
# Start local registry
tmp_registry_log=`mktemp`
echo "Registry output file: $tmp_registry_log"
(cd && nohup npx ${VERDACCIO_PACKAGE:-$default_verdaccio_package} -c $1 &>$tmp_registry_log &)

npm install --global verdaccio-memory
# Wait for Verdaccio to boot
grep -q "http address" <(tail -f $tmp_registry_log)
tail -f $tmp_registry_log &

# Set registry to local registry
export NPM_CONFIG_REGISTRY="$custom_registry_url"
Expand Down
6 changes: 5 additions & 1 deletion scripts/integration-tests/verdaccio-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ auth:
uplinks:
npmjs:
url: https://registry.npmjs.org/
agent_options:
keepAlive: true
maxSockets: 40
maxFreeSockets: 10

packages:
'@*/*':
Expand Down Expand Up @@ -54,7 +58,7 @@ middlewares:

# log settings
logs:
- { type: stdout, format: pretty, level: http }
- { type: stdout, format: pretty, level: trace }
#- {type: file, path: verdaccio.log, level: info}
#experiments:
# # support for npm token command
Expand Down