Commit 484c4d8
authored
fix: resolve duplicate test functions, nil panic, and missing Makefile target (#2267)
## Problem
Main is broken — `make test` fails due to 3 issues introduced by recent
PRs:
1. **Duplicate test functions** in `internal/server/` — PR #2092 and
#2096 both added `validAllowOnlyPolicy()` and overlapping
`TestNormalizeScopeKind_*` tests
2. **Nil pointer dereference** in `ParseToolArguments` — PR #2061 added
a log line that accesses `req.Params.Name` before the nil check
3. **Missing Makefile target** — `test-container-proxy` target and
container test file were lost in the squash merge of PR #2231
## Fixes
- Remove duplicate `validAllowOnlyPolicy()` from
`resolve_guard_policy_test.go` (keep `ensure_guard_initialized_test.go`
version)
- Remove duplicate `TestNormalizeScopeKind_*` tests from
`ensure_guard_initialized_test.go` (keep the more comprehensive set in
`resolve_guard_policy_test.go`)
- Fix test using string repos pattern (`"github/gh-aw*"`) — must be
`[]interface{}` array
- Fix assertion expecting `"approved"` — now correctly matches the
shared helper's `IntegrityNone`
- Move `ParseToolArguments` log line after the nil check
- Restore `test-container-proxy` Makefile target and
`proxy_container_test.go` (8 container integration tests)
## Verification
- `make agent-finished` ✅ all checks pass
- `make test-container-proxy` ✅ 7 pass, 1 skip (macOS gh CLI TLS —
expected)5 files changed
Lines changed: 474 additions & 86 deletions
File tree
- internal
- mcp
- server
- test/integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | 111 | | |
113 | 112 | | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 96 | | |
| 97 | + | |
167 | 98 | | |
168 | 99 | | |
169 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 11 | | |
23 | 12 | | |
24 | 13 | | |
| |||
234 | 223 | | |
235 | 224 | | |
236 | 225 | | |
237 | | - | |
| 226 | + | |
238 | 227 | | |
239 | 228 | | |
240 | 229 | | |
| |||
387 | 376 | | |
388 | 377 | | |
389 | 378 | | |
390 | | - | |
| 379 | + | |
391 | 380 | | |
392 | 381 | | |
393 | 382 | | |
| |||
0 commit comments