Skip to content

Commit 93d7a4e

Browse files
docs: add end-to-end testing instructions and Makefile targets for flagd provider (#733)
Signed-off-by: Georgiana Neagu <[email protected]>
1 parent 8e8d888 commit 93d7a4e

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

providers/flagd/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
.PHONY: mockgen
1+
.PHONY: mockgen e2e-test-build e2e-test-run
2+
23
mockgen:
34
mockgen -source=pkg/iservice.go -destination=internal/mock/service_mock.go -package=mock
5+
6+
e2e-test-build:
7+
cd providers/flagd/e2e && go build -tags=e2e
8+
9+
e2e-test-run:
10+
cd providers/flagd/e2e && go test -tags=e2e

providers/flagd/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,36 @@ provider, err := flagd.NewProvider(flagd.WithLogger(l)) // set the provider's lo
208208
[logr](https://github.com/go-logr/logr) uses incremental verbosity levels (akin to named levels but in integer form).
209209
The provider logs `warning` at level `0`, `info` at level `1` and `debug` at level `2`. Errors are always logged.
210210

211+
## Flagd End-to-End Testing
212+
213+
To run the end-to-end (e2e) tests for the flagd provider, follow these steps:
214+
215+
1. Initialize the `go.work` file in the root directory by running the following command:
216+
217+
```sh
218+
go work init
219+
```
220+
221+
2. Add the necessary modules to the workspace:
222+
223+
```sh
224+
go work use
225+
```
226+
227+
3. Navigate to the `providers/flagd/e2e` directory.
228+
229+
4. Build the tests:
230+
231+
```sh
232+
go build -tags=e2e
233+
```
234+
235+
5. Run the tests:
236+
237+
```sh
238+
go test -tags=e2e
239+
```
240+
211241
## License
212242

213243
Apache 2.0 - See [LICENSE](./../../LICENSE) for more information.

0 commit comments

Comments
 (0)