-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
162 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -2,19 +2,10 @@ | |
|
||
End-to-end tests for the `cli` library. | ||
|
||
## Running the tests | ||
## Included plugins | ||
- `tools/plugins/original.plugin.ts` | ||
|
||
- `nx e2e cli-e2e-original` - run E2E tests for the `cli-e2e-original` library. | ||
- run vitest setup - `e2e/cli-e2e-original/setup/global-setup.ts#setup` | ||
- `nx local-registry --storage` | ||
- `nx run-many --targets=nx-release-publish` | ||
- `nx run-many --targets=npm-install-e2e` | ||
- run tests | ||
- run vitest teardown - `e2e/cli-e2e-original/setup/global-setup.ts#teardown` | ||
- stop server | ||
- delete folder | ||
|
||
### Included targets | ||
### Dynamic targets generated by the plugin | ||
|
||
- `workspace-source` | ||
- targets | ||
|
@@ -29,6 +20,19 @@ End-to-end tests for the `cli` library. | |
- `original-npm.install` | ||
- `original-npm-uninstall` | ||
|
||
|
||
## Running the tests | ||
|
||
- `nx e2e cli-e2e-original` - run E2E tests for the `cli-e2e-original` library. | ||
- run vitest setup - `e2e/cli-e2e-original/setup/global-setup.ts#setup` | ||
- `nx local-registry --storage` | ||
- `nx run-many --targets=nx-release-publish` | ||
- `nx run-many --targets=npm-install-e2e` | ||
- run tests | ||
- run vitest teardown - `e2e/cli-e2e-original/setup/global-setup.ts#teardown` | ||
- stop server | ||
- delete folder | ||
|
||
### Changed or generated files during e2e | ||
|
||
```sh | ||
|
@@ -55,6 +59,96 @@ User/ | |
|
||
## Troubleshooting | ||
|
||
- `nx start-server` | ||
- `nx start-server <project-name>` | ||
- `nx start-server <project-name> --storage tmp/e2e/<project-name>/storage` | ||
### Is my environment free up from any artefacts from previous runs? | ||
|
||
1. Check if any package is installed from previouse runs | ||
- run `npm ls <package-name>` to see if the package is installed in your workspace | ||
Example output: | ||
```sh | ||
@org/[email protected] /Users/<user-name>/<workspace-root> | ||
└── <org>/<project-name>@0.0.1 # 👈 this is a potential left over package from your e2e test | ||
``` | ||
1. 1. Remove the package from your workspace | ||
- run `nx run-many -t npm-uninstall-original` to remove the package from your workspace | ||
Example output of clean `npm ls <package-name>` run: | ||
|
||
```sh | ||
@org/[email protected] /Users/<user-name>/<workspace-root> | ||
└── (empty) | ||
``` | ||
|
||
### Is my environment free up from any configuration from previous runs? | ||
|
||
1. Check if your environment is clean | ||
- run `npm config list -ls` to see if there are any unexpected registries or tokens in any of your config files | ||
Example Output: | ||
```sh | ||
; "default" config from default values | ||
# ... | ||
metrics-registry = "http://localhost:4873/" | ||
prefix = "/usr/local" | ||
# ... | ||
; registry = "https://registry.npmjs.org/" ; overridden by user | ||
# ... | ||
userconfig = "/Users/michael_hladky/.npmrc" | ||
# ... | ||
; "user" config from /Users/michael_hladky/.npmrc | ||
|
||
registry = "http://localhost:4873/" # 👈 this is a potential left over configuration form your e2e test | ||
|
||
; "cli" config from command line options | ||
|
||
# ... | ||
``` | ||
|
||
- Clean potential entries from your OS user specific npm config | ||
- `npm config delete registry` | ||
- `npm config delete <registry-name>:_authToken` | ||
|
||
Example output after cleanup: | ||
```sh | ||
; "default" config from default values | ||
|
||
# ... | ||
metrics-registry = "https://registry.npmjs.org/" | ||
prefix = "/usr/local" | ||
registry = "https://registry.npmjs.org/" | ||
# ... | ||
userconfig = "/Users/michael_hladky/.npmrc" | ||
# ... | ||
; "cli" config from command line options | ||
|
||
# ... | ||
``` | ||
|
||
### Is Verdaccio server running correctly? | ||
|
||
While the tests are running you can open your browser and visit http://localhost:<port>/ to see the Verdaccio web interface. | ||
|
||
To start it manually do the following steps: | ||
1. Start local registry manually with `nx local-registry --verbose` - logs port | ||
2. 1. Run `npm config list -ls` to see if the registry and auth token are configured correctly | ||
Example output with correct configuration: | ||
```sh | ||
; "default" config from default values | ||
# ... | ||
metrics-registry = "http://localhost:4873/" | ||
prefix = "/usr/local" | ||
# ... | ||
; registry = "https://registry.npmjs.org/" ; overridden by user | ||
# ... | ||
userconfig = "/Users/michael_hladky/.npmrc" | ||
# ... | ||
; "user" config from /Users/michael_hladky/.npmrc | ||
|
||
//localhost:4874/:_authToken = (protected) # 👈 this is the auth token for your Verdaccio registry | ||
registry = "http://localhost:4873/" # 👈 this the default registry | ||
|
||
; "cli" config from command line options | ||
|
||
# ... | ||
``` | ||
2. 2. Check if a package is published with `nx npm-check <project-name> --registry=http://localhost:4873` | ||
Example of an empty web interface: | ||
|
||
### Is my e2e script publishing to the right registry? |
This file contains 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 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 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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