Skip to content

Commit c9923d2

Browse files
authored
chore: Clean up verdaccio leftovers (#20866)
Noticed we still have a bunch of verdaccio leftovers and outdated docs in the repo.
1 parent 62096ee commit c9923d2

4 files changed

Lines changed: 13 additions & 340 deletions

File tree

dev-packages/e2e-tests/README.md

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ current state.
1515

1616
## How to run
1717

18-
Prerequisites: Docker
19-
2018
- Copy `.env.example` to `.env`
2119
- OPTIONAL: Fill in auth information in `.env` for an example Sentry project - you only need this to run E2E tests that
2220
send data to Sentry.
@@ -92,62 +90,40 @@ If you run `yarn test:run nextjs-pages-dir --variant 13`, it will match against
9290

9391
## How they work
9492

95-
Before running any tests we launch a fake test registry (in our case [Verdaccio](https://verdaccio.org/docs/e2e/)), we
96-
build our packages, pack them, and publish them to the fake registry. The fake registry is hosted in a Docker container,
97-
and the script to publish the packages is also run from within a container to ensure that the fake publishing happens
98-
with the same Node.js and npm versions as we're using in CI.
93+
We build our packages, pack them into tarballs (`yarn build:tarball`), and create symlinks in the `packed/` directory
94+
that point to the versioned tarballs. When a test application is run, pnpm overrides are injected into its
95+
`package.json` to pin all `@sentry/*` and `@sentry-internal/*` packages to those local tarballs. This means test apps
96+
install the packages as if they were published, but from the local build output instead of a registry.
9997

100-
After publishing our freshly built packages to the fake registry, the E2E test script will look for `test-recipe.json`
101-
files in test applications located in the `test-applications` folder. In this folder, we keep standalone test
102-
applications, that use our SDKs and can be used to verify their behavior. The `test-recipe.json` recipe files contain
103-
information on how to build the test applications and how to run tests on these applications.
98+
The E2E test script looks for test applications in the `test-applications` folder. These are standalone apps that use
99+
our SDKs and can be used to verify their behavior.
104100

105101
## How to set up a new test
106102

107-
Test applications are completely standalone applications that can be used to verify our SDKs. To set one up, follow
108-
these commands:
103+
Test applications are completely standalone applications that can be used to verify our SDKs. To set one up:
109104

110105
```sh
111106
cd dev-packages/e2e-tests
112-
113-
# Create a new test application folder
114-
mkdir test-applications/my-new-test-application # Name of the new folder doesn't technically matter but choose something meaningful
115-
116-
# Create an npm configuration file that uses the fake test registry
117-
cat > test-applications/my-new-test-application/.npmrc << EOF
118-
@sentry:registry=http://127.0.0.1:4873
119-
@sentry-internal:registry=http://127.0.0.1:4873
120-
EOF
107+
mkdir test-applications/my-new-test-application
121108
```
122109

123110
Make sure to add a `test:build` and `test:assert` command to the new app's `package.json` file.
124111

125-
### The `.npmrc` File
126-
127-
Every test application needs an `.npmrc` file (as shown above) to tell pnpm to fetch `@sentry/*` and `@sentry-internal/*` packages from the local Verdaccio registry. Without it, pnpm will install from the public npm registry and your local changes won't be tested - this is one of the most common causes of confusing test failures.
128-
129-
To verify packages are being installed from Verdaccio, check the version in `node_modules/@sentry/*/package.json`. If it shows something like `0.0.0-pr.12345`, Verdaccio is working. If it shows a released version (e.g., `8.0.0`), the `.npmrc` is missing or incorrect.
112+
Sentry packages are automatically resolved to the local build via pnpm overrides injected at test time, so no manual
113+
registry configuration is needed.
130114

131115
## Troubleshooting
132116

133117
### Common Issues
134118

135119
#### Tests fail with "Cannot find module '@sentry/...'" or use wrong package version
136120

137-
1. Verify the test application has an `.npmrc` file (see above)
138-
2. Rebuild tarballs: `yarn build && yarn build:tarball`
121+
1. Rebuild tarballs: `yarn build && yarn build:tarball`
122+
2. Re-run `yarn test:prepare` to refresh symlinks
139123
3. Delete `node_modules` in the test application and re-run the test
140124

141-
#### Docker/Verdaccio issues
142-
143-
- Ensure Docker daemon is running
144-
- Check that port 4873 is not already in use: `lsof -i :4873`
145-
- Stop any existing Verdaccio containers: `docker ps` and `docker stop <container-id>`
146-
- Check Verdaccio logs for errors
147-
148125
#### Tests pass locally but fail in CI (or vice versa)
149126

150-
- Most likely cause: missing `.npmrc` file
151127
- Verify all `@sentry/*` dependencies use `latest || *` version specifier
152128
- Check if the test relies on environment-specific behavior
153129

@@ -206,10 +182,7 @@ For example, if something is changed in the browser package, only E2E test apps
206182
You can add additional information about the test (e.g. canary versions, optional in CI) by adding `sentryTest` in the `package.json`
207183
of a test application.
208184

209-
**An important thing to note:** In the context of the build/test commands the fake test registry is available at
210-
`http://127.0.0.1:4873`. It hosts all of our packages as if they were to be published with the state of the current
211-
branch. This means we can install the packages from this registry via the `.npmrc` configuration as seen above. If you
212-
add Sentry dependencies to your test application, you should set the dependency versions set to `latest || *` in order
185+
If you add Sentry dependencies to your test application, set the dependency versions to `latest || *` in order
213186
for it to work with both regular and prerelease versions:
214187

215188
```jsonc

dev-packages/e2e-tests/verdaccio-config/config.yaml

Lines changed: 0 additions & 294 deletions
This file was deleted.

0 commit comments

Comments
 (0)