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: docs/testing.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,7 @@ make test
15
15
For generating mocks, the `mockery` tool is used. For `mockery` installation, follow the instructions on
16
16
the [official docs](https://vektra.github.io/mockery/latest/).
17
17
18
-
**Note**: Mock generation is also run as part of the CI pipeline, so you can check if the mocks are up-to-date by
19
-
running the tests. However, It is recommended to run the tests locally before pushing your changes.
18
+
**Note**: Mocks are not checked in and are instead generated on-the-fly as part of the CI pipeline. If your local tests fail, it may be due to your mocks being out-of-date. This can be fixed by re-generating the mocks. It is recommended to run the tests locally before pushing your changes.
20
19
21
20
When adding new interfaces and needing to generate mocks, you should:
22
21
@@ -28,4 +27,15 @@ When adding new interfaces and needing to generate mocks, you should:
28
27
```sh
29
28
mockery
30
29
```
30
+
Alternatively, you may generate the mocks via make target:
31
+
```sh
32
+
make mocks
33
+
```
34
+
35
+
## Toxiproxy
31
36
37
+
For testing the resilience of the library against network issues, some tests use Toxiproxy.
38
+
If you wish to run the network tests locally (without docker compose) you need to:
39
+
- Install [toxiproxy](https://github.com/Shopify/toxiproxy) for your platform
40
+
- Start a local toxiproxy - `toxiproxy-server -port 8474 -host localhost`
41
+
- Run the tests - `go fmt ./... && go vet ./... && go test -v -count=1 -failfast ./...`
0 commit comments