History

Read stdin before validating required image flag in codex test stub

- Move stdin capture earlier in fake codex script setup - Ensure stdin-based assertions remain available even when image validation fails

Julius Marminge committed 8 months ago

Commit 596e1591 parent 70c91471 file · +1 −1Browse files

Unified · Split

apps/server/src/git/Layers/CodexTextGeneration.test.ts+1−1
@@ -41,11 +41,11 @@ function makeFakeCodexBinary(dir: string) { · 40 unmodified lines
41 " fi",41 " fi",
42 " shift",42 " shift",
43 "done",43 "done",
44 'stdin_content="$(cat)"',
44 'if [ "$T3_FAKE_CODEX_REQUIRE_IMAGE" = "1" ] && [ "$seen_image" != "1" ]; then',45 'if [ "$T3_FAKE_CODEX_REQUIRE_IMAGE" = "1" ] && [ "$seen_image" != "1" ]; then',
45 ' printf "%s\\n" "missing --image input" >&2',46 ' printf "%s\\n" "missing --image input" >&2',
46 " exit 2",47 " exit 2",
47 "fi",48 "fi",
48 'stdin_content="$(cat)"',
49 'if [ -n "$T3_FAKE_CODEX_STDIN_MUST_CONTAIN" ]; then',49 'if [ -n "$T3_FAKE_CODEX_STDIN_MUST_CONTAIN" ]; then',
50 ' printf "%s" "$stdin_content" | grep -F -- "$T3_FAKE_CODEX_STDIN_MUST_CONTAIN" >/dev/null || {',50 ' printf "%s" "$stdin_content" | grep -F -- "$T3_FAKE_CODEX_STDIN_MUST_CONTAIN" >/dev/null || {',
51 ' printf "%s\\n" "stdin missing expected content" >&2',51 ' printf "%s\\n" "stdin missing expected content" >&2',