From 4b4c5635ee9cdceb2f146379d4816bd17b0b009a Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Thu, 6 Aug 2026 22:29:25 +0900 Subject: [PATCH] test: expose malformed hourly workflow printf lines --- tests/test_hourly_opencode_nvidia_contract.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_hourly_opencode_nvidia_contract.py b/tests/test_hourly_opencode_nvidia_contract.py index dc1410e..47c6483 100644 --- a/tests/test_hourly_opencode_nvidia_contract.py +++ b/tests/test_hourly_opencode_nvidia_contract.py @@ -128,3 +128,20 @@ def test_buyer_readme_identifies_the_opencode_nvidia_maintainer() -> None: assert "bounded OpenCode maintainer" in readme assert "`NVIDIA_NIM_API_KEY`" in readme assert "COPILOT_GITHUB_TOKEN" not in readme + + +def test_product_workflow_keeps_printf_escapes_on_indented_yaml_lines() -> None: + """Keep shell format escapes on one YAML line so workflow parsing succeeds.""" + workflow_lines = _read(PRODUCT_WORKFLOW_PATH).splitlines() + checksum_line = ( + " printf '%s %s\\n' " + '"$OPENCODE_SHA256" "$archive" | sha256sum --check -' + ) + fallback_line = ( + " printf '%s\\n' " + "'{\"type\":\"error\",\"message\":\"OpenCode produced no final result\"}' " + '>"$result_file"' + ) + + assert checksum_line in workflow_lines + assert fallback_line in workflow_lines