Skip to content

Commit db7f6de

Browse files
lpcoxCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 26328c8 commit db7f6de

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

internal/middleware/jqschema_wrap_coverage_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,12 @@ func TestWrapToolHandler_SchemaGenerationError_CanceledContext(t *testing.T) {
208208

209209
// When applyJqSchema fails (lines 724-726), lines 729-734 return the original
210210
// result and data rather than a PayloadMetadata struct.
211-
_, isMetadata := data.(PayloadMetadata)
212-
if isMetadata {
213-
// gojq completed before checking the cancelled context (fast execution).
214-
// In this case the schema was generated successfully and we got metadata —
215-
// the schema-error path was not triggered. This is a valid fast-execution
216-
// outcome; skip the remaining assertions.
217-
t.Skip("gojq completed before context check; schema error path not triggered (fast execution)")
211+
meta, ok := data.(PayloadMetadata)
212+
if ok {
213+
// Schema generation succeeded despite the canceled context; validate basic metadata fields.
214+
assert.NotEmpty(t, meta.PayloadPath)
215+
assert.NotNil(t, meta.PayloadSchema)
216+
return
218217
}
219218

220219
// Schema generation failed → original result returned.

0 commit comments

Comments
 (0)