Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/endToEndTests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test end to end

on:
pull_request:
branches:
- develop
- release
push:
branches:
- develop
- release
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is one thing I'm not sure about — when should the end-to-end tests run? Right now I have it on any PR to develop or release, should I also be having it run once they merge into develop and release as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine for now, I'll be working on the e2e suite so I'll revisit once I look at it a bit more


jobs:
test-end-to-end:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- run: echo "::add-path::$(yarn global bin)"
- name: Check out Optic Repo
uses: actions/checkout@v2
with:
path: ./optic-repo
- name: Release Optic Locally
run: |
source sourceme.sh && optic_local_registry_start
source sourceme.sh && optic_build_and_publish_locally
working-directory: ./optic-repo
- uses: actions/checkout@v2
with:
repository: opticdev/optic-end-end-tests
token: ${{ secrets.END_TO_END_ACCESS_KEY }}
path: ./tests
- run: npm install
working-directory: ./tests
- run: npm test
working-directory: ./tests
env:
DEBUG: "*,-babel*" # Helps with tracing errors
7 changes: 5 additions & 2 deletions docker/private-npm-registry/conf/config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
storage: /verdaccio/storage
store:
memory:
limit: 1000
packages:
'@useoptic/*':
access: $all
publish: $all
proxy: npmjs
'*/*':
access: $all
proxy: npmjs
Expand All @@ -13,4 +16,4 @@ uplinks:
npmjs:
url: https://registry.npmjs.org/
logs:
- {type: stdout, format: pretty, level: trace}
- {type: stdout, format: pretty, level: trace}
12 changes: 3 additions & 9 deletions docker/private-npm-registry/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
version: '2.1'
services:
verdaccio:
image: verdaccio/verdaccio:4
container_name: verdaccio-docker-local-storage-vol
image: verdaccio/verdaccio:4.6
container_name: verdaccio-local-registry
ports:
- "4873:4873"
volumes:
- "./storage:/verdaccio/storage"
- "./conf:/verdaccio/conf"
volumes:
verdaccio:
driver: local
- "4873:4873"
17 changes: 16 additions & 1 deletion sourceme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ optic_build_and_publish_locally() {
set -o errexit
optic_build_for_release
cd "$OPTIC_SRC_DIR"
yarn run publish-local
npm-cli-login -u testUser -p testPass -e test@example.com -r http://localhost:4873
OPTIC_PUBLISH_SCOPE=private node ./workspaces/scripts/publish.js
)
}
optic_release_and_install_locally() {
Expand All @@ -127,3 +128,17 @@ optic_install_from_local_registry() {
)
}
# DEBUG=optic* apidev daemon:stop && DEBUG=optic* apidev agent:start
optic_local_registry_start() {
(
set -o errexit
cd "$OPTIC_SRC_DIR"
cd docker/private-npm-registry
yarn global add verdaccio-memory npm-cli-login
docker-compose up &

cd "$OPTIC_SRC_DIR"
yarn install
yarn wait-on http://localhost:4873
printf "local npm registry started on http://localhost:4873 \n"
)
}
2 changes: 1 addition & 1 deletion workspaces/scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ promise
'npm',
isPrivatePublish
? ['publish', '--registry', registry]
: ['publish', '--access', 'public'],
: ['publish', '--access', 'public', '-ddd'],
{
cwd,
stdio: 'inherit',
Expand Down