Skip to content

Commit cb1b0a6

Browse files
mikolalysenkoclaude
andcommitted
test(docker): pin the content_mismatch_overwritten warning in the force-apply gates
With scan pinned to --strict, the dedicated `apply --force` step is the writer again — but force-overwriting the all-zeros-baseline fixture now also surfaces the content_mismatch_overwritten warning as a Skipped event, so the old `skipped:0` gates fail. Assert the new contract instead: exactly one skip AND the warning's errorCode present (cargo/golang/maven/nuget×2; composer has no skipped gate). All five suites verified locally against freshly built images. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 6091280 commit cb1b0a6

4 files changed

Lines changed: 50 additions & 10 deletions

File tree

crates/socket-patch-cli/tests/docker_e2e_cargo.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,16 @@ grep -q '"failed": 0,' /tmp/apply.out || {{
228228
cat /tmp/apply.out >&2
229229
exit 1
230230
}}
231-
grep -q '"skipped": 0,' /tmp/apply.out || {{
232-
echo "FAIL: apply JSON did not report skipped:0" >&2
231+
# The --force overwrite of the mismatched baseline surfaces the
232+
# content_mismatch_overwritten warning as a Skipped event (the
233+
# mismatch-warn contract) — exactly that one, nothing else skipped.
234+
grep -q '"skipped": 1,' /tmp/apply.out || {{
235+
echo "FAIL: apply JSON did not report skipped:1 (the mismatch-overwrite warning)" >&2
236+
cat /tmp/apply.out >&2
237+
exit 1
238+
}}
239+
grep -q '"errorCode": "content_mismatch_overwritten"' /tmp/apply.out || {{
240+
echo "FAIL: apply JSON missing the content_mismatch_overwritten warning event" >&2
233241
cat /tmp/apply.out >&2
234242
exit 1
235243
}}

crates/socket-patch-cli/tests/docker_e2e_golang.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,16 @@ grep -qE '^[[:space:]]*"failed": 0,[[:space:]]*$' /tmp/apply.out || {{
209209
cat /tmp/apply.out >&2
210210
exit 1
211211
}}
212-
grep -qE '^[[:space:]]*"skipped": 0,[[:space:]]*$' /tmp/apply.out || {{
213-
echo "FAIL: apply JSON reported a non-zero skipped count" >&2
212+
# The --force overwrite of the mismatched baseline surfaces the
213+
# content_mismatch_overwritten warning as a Skipped event (the
214+
# mismatch-warn contract) — exactly that one, nothing else skipped.
215+
grep -qE '^[[:space:]]*"skipped": 1,[[:space:]]*$' /tmp/apply.out || {{
216+
echo "FAIL: apply JSON did not report skipped:1 (the mismatch-overwrite warning)" >&2
217+
cat /tmp/apply.out >&2
218+
exit 1
219+
}}
220+
grep -q '"errorCode": "content_mismatch_overwritten"' /tmp/apply.out || {{
221+
echo "FAIL: apply JSON missing the content_mismatch_overwritten warning event" >&2
214222
cat /tmp/apply.out >&2
215223
exit 1
216224
}}

crates/socket-patch-cli/tests/docker_e2e_maven.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,16 @@ grep -q '"failed": 0,' /tmp/apply.out || {{
235235
cat /tmp/apply.out >&2
236236
exit 1
237237
}}
238-
grep -q '"skipped": 0,' /tmp/apply.out || {{
239-
echo "FAIL: apply JSON did not report skipped:0" >&2
238+
# The --force overwrite of the mismatched baseline surfaces the
239+
# content_mismatch_overwritten warning as a Skipped event (the
240+
# mismatch-warn contract) — exactly that one, nothing else skipped.
241+
grep -q '"skipped": 1,' /tmp/apply.out || {{
242+
echo "FAIL: apply JSON did not report skipped:1 (the mismatch-overwrite warning)" >&2
243+
cat /tmp/apply.out >&2
244+
exit 1
245+
}}
246+
grep -q '"errorCode": "content_mismatch_overwritten"' /tmp/apply.out || {{
247+
echo "FAIL: apply JSON missing the content_mismatch_overwritten warning event" >&2
240248
cat /tmp/apply.out >&2
241249
exit 1
242250
}}

crates/socket-patch-cli/tests/docker_e2e_nuget.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,16 @@ grep -q '"failed": 0,' /tmp/apply.out || {{
240240
cat /tmp/apply.out >&2
241241
exit 1
242242
}}
243-
grep -q '"skipped": 0,' /tmp/apply.out || {{
244-
echo "FAIL: apply JSON did not report skipped:0" >&2
243+
# The --force overwrite of the mismatched baseline surfaces the
244+
# content_mismatch_overwritten warning as a Skipped event (the
245+
# mismatch-warn contract) — exactly that one, nothing else skipped.
246+
grep -q '"skipped": 1,' /tmp/apply.out || {{
247+
echo "FAIL: apply JSON did not report skipped:1 (the mismatch-overwrite warning)" >&2
248+
cat /tmp/apply.out >&2
249+
exit 1
250+
}}
251+
grep -q '"errorCode": "content_mismatch_overwritten"' /tmp/apply.out || {{
252+
echo "FAIL: apply JSON missing the content_mismatch_overwritten warning event" >&2
245253
cat /tmp/apply.out >&2
246254
exit 1
247255
}}
@@ -362,8 +370,16 @@ grep -q '"failed": 0,' /tmp/apply.out || {{
362370
cat /tmp/apply.out >&2
363371
exit 1
364372
}}
365-
grep -q '"skipped": 0,' /tmp/apply.out || {{
366-
echo "FAIL: apply JSON did not report skipped:0" >&2
373+
# The --force overwrite of the mismatched baseline surfaces the
374+
# content_mismatch_overwritten warning as a Skipped event (the
375+
# mismatch-warn contract) — exactly that one, nothing else skipped.
376+
grep -q '"skipped": 1,' /tmp/apply.out || {{
377+
echo "FAIL: apply JSON did not report skipped:1 (the mismatch-overwrite warning)" >&2
378+
cat /tmp/apply.out >&2
379+
exit 1
380+
}}
381+
grep -q '"errorCode": "content_mismatch_overwritten"' /tmp/apply.out || {{
382+
echo "FAIL: apply JSON missing the content_mismatch_overwritten warning event" >&2
367383
cat /tmp/apply.out >&2
368384
exit 1
369385
}}

0 commit comments

Comments
 (0)