-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(e2e): Set up fake registry for E2E tests #5806
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
d3f1674
test(e2e): Set up test registry for E2E tests
lforst f9a0577
Use local npmrc to publish to test registry
lforst 4e1d6d1
Convert to TS script
lforst 4bb7418
Yarn install in workflow
lforst d206f82
Remove cwd to fix CI?
lforst 4996956
Remove node env to fix CI?
lforst 923be27
Pass current env to fix CI?
lforst a904675
Add registry flag to fix CI???
lforst c1537e1
Omg just work
lforst 55e6561
Omg just work
lforst 7c43399
Finally
lforst 7cdc527
Add individual packages to verdaccio config
lforst fc14bbb
Clean up dependencies?
lforst 5c9e8ed
Move e2e tests into workspace
lforst ea0155f
Rename verdaccio config folder
lforst c16a103
Extract verdaccio version into const
lforst 519f598
Rename ci step
lforst 0709dd6
Add license
lforst 8eb8cc7
Remove node types
lforst ea33b5f
Turn off npm audit in verdaccio config
lforst 25335fb
Add lint command
lforst 432c850
Add yaml package and pin deps
lforst 1904a06
Add quick validation script
lforst a7c5664
Containerize the process of publishing packages to fake registry
lforst 8c3e5e6
Update eslintrc
lforst d648a03
Improve log message in validation script
lforst c5e4c20
Remove -it flag from docker run
lforst dfe6809
Remove --sig-proxy flag
lforst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
SCRIPT=$(readlink -f "$0") # Absolute path to this script | ||
SCRIPT_DIR=$(dirname "$SCRIPT") # Absolute path of directory containing this script | ||
|
||
cd $SCRIPT_DIR/.. # Navigate to root of repository to build all the packages | ||
yarn build:npm # create tarballs | ||
|
||
# Stop Verdaccio Test Registry container if it was already running - don't throw if container wasn't running | ||
docker stop verdaccio-e2e-test-registry || true | ||
|
||
# Start Verdaccio Test Registry | ||
docker run --detach --rm \ | ||
--name verdaccio-e2e-test-registry \ | ||
-p 4873:4873 \ | ||
-v $SCRIPT_DIR/verdaccio/conf:/verdaccio/conf \ | ||
verdaccio/verdaccio:5.15.3 | ||
|
||
# Publish built packages to Verdaccio Test Registry | ||
for package in "$SCRIPT_DIR"/../packages/*/sentry-*.tgz; do | ||
npm publish $package --registry http://localhost:4873 | ||
done | ||
|
||
# TODO: Run e2e tests here | ||
|
||
docker stop verdaccio-e2e-test-registry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Taken from https://github.com/babel/babel/blob/624c78d99e8f42b2543b8943ab1b62bd71cf12d8/scripts/integration-tests/verdaccio-config.yml | ||
|
||
# | ||
# This is the default config file. It allows all users to do anything, | ||
# so don't use it on production systems. | ||
# | ||
# Look here for more config file examples: | ||
# https://github.com/verdaccio/verdaccio/tree/master/conf | ||
# | ||
|
||
# path to a directory with all packages | ||
storage: /verdaccio/storage/data | ||
|
||
# https://verdaccio.org/docs/configuration#authentication | ||
auth: | ||
htpasswd: | ||
file: /verdaccio/storage/htpasswd | ||
|
||
# https://verdaccio.org/docs/configuration#uplinks | ||
# a list of other known repositories we can talk to | ||
uplinks: | ||
npmjs: | ||
url: https://registry.npmjs.org/ | ||
|
||
# Learn how to protect your packages | ||
# https://verdaccio.org/docs/protect-your-dependencies/ | ||
# https://verdaccio.org/docs/configuration#packages | ||
packages: | ||
'@*/*': | ||
# scoped packages | ||
access: $all | ||
publish: $all | ||
unpublish: $all | ||
# proxy: npmjs # Don't proxy for E2E tests! | ||
|
||
'**': | ||
# allow all users (including non-authenticated users) to read and | ||
# publish all packages | ||
# | ||
# you can specify usernames/groupnames (depending on your auth plugin) | ||
# and three keywords: "$all", "$anonymous", "$authenticated" | ||
access: $all | ||
|
||
# allow all known users to publish/publish packages | ||
# (anyone can register by default, remember?) | ||
publish: $all | ||
unpublish: $all | ||
# proxy: npmjs # Don't proxy for E2E tests! | ||
|
||
# https://verdaccio.org/docs/configuration#server | ||
# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections. | ||
# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout. | ||
# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough. | ||
server: | ||
keepAliveTimeout: 60 | ||
|
||
middlewares: | ||
audit: | ||
enabled: true | ||
|
||
# https://verdaccio.org/docs/logger | ||
# log settings | ||
logs: { type: stdout, format: pretty, level: http } | ||
#experiments: | ||
# # support for npm token command | ||
# token: false |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make this a node script so we stay windows friendly before we dive deeper into bash land