You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/e2e-tests/README.md
+22-14Lines changed: 22 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# E2E Tests
2
2
3
-
E2E tests enable us to verify the behavior of the packages in this repository as if they were to be published in their current state.
3
+
E2E tests enable us to verify the behavior of the packages in this repository as if they were to be published in their
4
+
current state.
4
5
5
6
## How to run
6
7
@@ -12,17 +13,20 @@ yarn test:e2e
12
13
13
14
## How they work
14
15
15
-
Before running any tests we launch a fake test registry (in our case [Verdaccio](https://verdaccio.org/docs/e2e/)), we build our packages, pack them, and publish them to the fake registry.
16
-
The fake registry is hosted in a Docker container, and the script to publish the packages is also run from within a container to ensure that the fake publishing happens with the same Node.js and npm versions as we're using in CI.
16
+
Before running any tests we launch a fake test registry (in our case [Verdaccio](https://verdaccio.org/docs/e2e/)), we
17
+
build our packages, pack them, and publish them to the fake registry. The fake registry is hosted in a Docker container,
18
+
and the script to publish the packages is also run from within a container to ensure that the fake publishing happens
19
+
with the same Node.js and npm versions as we're using in CI.
17
20
18
-
After publishing our freshly built packages to the fake registry, the E2E test script will look for `test-recipe.json` files in test applications located in the `test-applications` folder.
19
-
In this folder, we keep standalone test applications, that use our SDKs and can be used to verify their behavior.
20
-
The `test-recipe.json` recipe files contain information on how to build the test applications and how to run tests on these applications.
21
+
After publishing our freshly built packages to the fake registry, the E2E test script will look for `test-recipe.json`
22
+
files in test applications located in the `test-applications` folder. In this folder, we keep standalone test
23
+
applications, that use our SDKs and can be used to verify their behavior. The `test-recipe.json` recipe files contain
24
+
information on how to build the test applications and how to run tests on these applications.
21
25
22
26
## How to set up a new test
23
27
24
-
Test applications are completely standalone applications that can be used to verify our SDKs.
25
-
To set one up, follow these commands:
28
+
Test applications are completely standalone applications that can be used to verify our SDKs. To set one up, follow
29
+
these commands:
26
30
27
31
```sh
28
32
cd packages/e2e-tests
@@ -63,15 +67,19 @@ To get you started with the recipe, you can copy the following into `test-recipe
63
67
}
64
68
```
65
69
66
-
The `test-recipe.json` files follow a schema (`e2e-tests/test-recipe-schema.json`). Here is a basic explanation of the fields:
70
+
The `test-recipe.json` files follow a schema (`e2e-tests/test-recipe-schema.json`). Here is a basic explanation of the
71
+
fields:
67
72
68
-
- The `buildCommand` command runs only once before any of the tests and is supposed to build the test application. If this command returns a non-zero exit code, it counts as a failed test and the test application's tests are not run.
69
-
- The `testCommand` command is supposed to run tests on the test application. If the configured command returns a non-zero exit code, it counts as a failed test.
73
+
- The `buildCommand` command runs only once before any of the tests and is supposed to build the test application. If
74
+
this command returns a non-zero exit code, it counts as a failed test and the test application's tests are not run.
75
+
- The `testCommand` command is supposed to run tests on the test application. If the configured command returns a
76
+
non-zero exit code, it counts as a failed test.
70
77
- A test timeout can be configured via `timeoutSeconds`, it defaults to `60`.
71
78
72
-
**An important thing to note:** In the context of the `buildCommand` the fake test registry is available at `http://localhost:4873`. It hosts all of our packages as if they were to be published with the state of the current branch.
73
-
This means we can install the packages from this registry via the `.npmrc` configuration as seen above.
74
-
If you add Sentry dependencies to your test application, you should set the dependency versions set to `*`:
79
+
**An important thing to note:** In the context of the `buildCommand` the fake test registry is available at
80
+
`http://localhost:4873`. It hosts all of our packages as if they were to be published with the state of the current
81
+
branch. This means we can install the packages from this registry via the `.npmrc` configuration as seen above. If you
82
+
add Sentry dependencies to your test application, you should set the dependency versions set to `*`:
0 commit comments