Skip to content

Commit 42bd829

Browse files
docs: how to debug integration tests (#1067)
* docs: how to debug integration tests Signed-off-by: zhengkezhou1 <[email protected]> * move to dev guide Signed-off-by: zhengkezhou1 <[email protected]> * Update site-src/contributing/devguide.md Co-authored-by: Nir Rozenbaum <[email protected]> * run test in shell Signed-off-by: zhengkezhou1 <[email protected]> --------- Signed-off-by: zhengkezhou1 <[email protected]> Co-authored-by: Nir Rozenbaum <[email protected]>
1 parent 478069d commit 42bd829

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

site-src/contributing/devguide.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Developer Guide
2+
3+
## Integration Tests Debug Guide
4+
This document provides detailed instructions on how to run and debug integration tests locally in debug mode.
5+
6+
### Prerequisites
7+
8+
#### 1. Install Required Tools
9+
Ensure the envtest tool is installed:
10+
```bash
11+
$ make envtest
12+
```
13+
14+
#### 2. Verify Kubernetes Test Environment
15+
Run the following command to set up and verify the test environment:
16+
```bash
17+
$ ./bin/setup-envtest use 1.31.0 --bin-dir ./bin -p path
18+
bin/k8s/1.31.0-darwin-arm64
19+
```
20+
### Run test in shell
21+
```shell
22+
export KUBEBUILDER_ASSETS=<project-root-path>/bin/k8s/1.31.0-<platform-architecture>
23+
go test sigs.k8s.io/gateway-api-inference-extension/test/integration/epp -run <test-function-name>
24+
```
25+
26+
### Configure and Run in GoLand
27+
28+
#### 1. Create Test Configuration
29+
Select the test case you want to debug:
30+
![](../images/modify-run-configuration.png)
31+
32+
#### 2. Configure Environment Variables
33+
Set environment variables in the Run/Debug Configuration:
34+
35+
![](../images/edit-environment-variables.png)
36+
37+
**Required environment variable:**
38+
39+
- **Name:** `KUBEBUILDER_ASSETS`
40+
- **Value:** `<project-root-path>/bin/k8s/1.31.0-<platform-architecture>`
41+
42+
**Example path:**
43+
```
44+
/go/src/kubernetes.io/gateway-api-inference-extension/bin/k8s/1.31.0-darwin-arm64
45+
```
46+
47+
#### 3. Set Breakpoints and Run
48+
49+
Example Output:
50+
51+
![](../images/running-example.png)
660 KB
Loading
593 KB
Loading
641 KB
Loading

0 commit comments

Comments
 (0)