From f65a8052581ed7860e3f441a06fe207947546e5c Mon Sep 17 00:00:00 2001 From: repo-worker-code Date: Tue, 3 Nov 2026 00:03:28 -0600 Subject: [PATCH] fix(opencode-config-normalize): check failure counter after final regression case (#4771) normalize_test.sh's only nonzero-failure check ran before the final comment-before-agent-last case, so a failure there printed FAIL yet the suite still exited 0. Move the check below the last case so every assertion affects the exit status. --- pkgs/opencode-config-normalize/normalize_test.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/opencode-config-normalize/normalize_test.sh b/pkgs/opencode-config-normalize/normalize_test.sh index a6e5baae63..57c17787b9 100755 --- a/pkgs/opencode-config-normalize/normalize_test.sh +++ b/pkgs/opencode-config-normalize/normalize_test.sh @@ -500,10 +500,6 @@ grep -qF 'https://example.com/docs */' "$tmp/plugins-merge-url-comment.jsonc" || failures=$((failures + 1)) } -if [ "$failures" -ne 0 ]; then - echo "normalize_test: $failures failure(s)" - exit 1 -fi # Case: agent as the last entry, with an inline comment between the # preceding entry's comma and the agent key (PR #4625 Codex P2). The # backward separator scan in delete_top_level_entry must skip the @@ -522,4 +518,9 @@ EOF check comment-before-agent-last "$tmp/comment-before-agent-last.fixture" \ '{"$schema":"https://opencode.ai/config.json","agents":{"build":{"model":"anthropic/claude-sonnet-4-5"},"plan":{"model":"anthropic/claude-sonnet-4-5"}}}' 0 +if [ "$failures" -ne 0 ]; then + echo "normalize_test: $failures failure(s)" + exit 1 +fi + echo "normalize_test: all cases passed"