Commit 88f9172
committed
Fix binary scan SimpleJson tests - change errorExpected from true to false
Root cause: Tests had errorExpected=true, causing assert.Error(t, err)
to be called, which produces no JSON output. This led to 'unexpected
end of JSON input' errors when trying to validate results.
Docker scan tests (which pass) don't use errorExpected - they just
run scans and validate output. Binary scan tests should do the same.
Fixed tests:
- TestXrayBinaryScanSimpleJson (line 103): true → false
- TestXrayBinaryScanSimpleJsonWithProgress (line 172): true → false
These tests create policies/watches and expect successful scans with
violations, not errors. Now they will:
1. Run scan successfully (no error assertion)
2. Get valid SimpleJson output with violations
3. Successfully validate the results1 parent c832488 commit 88f9172
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
0 commit comments