|
| 1 | +#!/usr/bin/env bash |
| 2 | +# tests/skills/test-no-chained-ticket-close.sh |
| 3 | +# Validates that agent-facing docs do NOT chain ticket comment + ticket |
| 4 | +# transition in a way that suggests a single Bash tool call. |
| 5 | +# |
| 6 | +# Bug: b53d-00b0 — chained commands exceed ~73s timeout, silently dropping |
| 7 | +# the transition. |
| 8 | +# |
| 9 | +# Usage: bash tests/skills/test-no-chained-ticket-close.sh |
| 10 | + |
| 11 | +set -uo pipefail |
| 12 | + |
| 13 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 14 | +REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" |
| 15 | + |
| 16 | +source "$REPO_ROOT/tests/lib/assert.sh" |
| 17 | + |
| 18 | +# ============================================================================= |
| 19 | +# Test 1: sprint SKILL.md does not chain comment + transition |
| 20 | +# ============================================================================= |
| 21 | +echo "" |
| 22 | +echo "--- test_sprint_no_chained_comment_transition ---" |
| 23 | +_snapshot_fail |
| 24 | + |
| 25 | +_SPRINT_CHAIN="not_found" |
| 26 | +grep -q 'ticket comment.*+.*ticket transition\|ticket comment.*then.*ticket transition' \ |
| 27 | + "$REPO_ROOT/plugins/dso/skills/sprint/SKILL.md" 2>/dev/null && _SPRINT_CHAIN="found" |
| 28 | +assert_eq "test_sprint_no_chained_comment_transition" "not_found" "$_SPRINT_CHAIN" |
| 29 | + |
| 30 | +assert_pass_if_clean "test_sprint_no_chained_comment_transition" |
| 31 | + |
| 32 | +# ============================================================================= |
| 33 | +# Test 2: debug-everything SKILL.md does not chain comment + transition |
| 34 | +# ============================================================================= |
| 35 | +echo "" |
| 36 | +echo "--- test_debug_everything_no_chained_comment_transition ---" |
| 37 | +_snapshot_fail |
| 38 | + |
| 39 | +_DEBUG_CHAIN="not_found" |
| 40 | +grep -q 'ticket comment.*then.*ticket transition\|ticket comment.*+.*ticket transition' \ |
| 41 | + "$REPO_ROOT/plugins/dso/skills/debug-everything/SKILL.md" 2>/dev/null && _DEBUG_CHAIN="found" |
| 42 | +assert_eq "test_debug_everything_no_chained_comment_transition" "not_found" "$_DEBUG_CHAIN" |
| 43 | + |
| 44 | +assert_pass_if_clean "test_debug_everything_no_chained_comment_transition" |
| 45 | + |
| 46 | +# ============================================================================= |
| 47 | +# Test 3: bug-type close commands use --reason (not separate comment) |
| 48 | +# Sprint and debug-everything should use --reason for bug close, not a |
| 49 | +# separate ticket comment call. |
| 50 | +# ============================================================================= |
| 51 | +echo "" |
| 52 | +echo "--- test_bug_close_uses_reason_flag_in_sprint ---" |
| 53 | +_snapshot_fail |
| 54 | + |
| 55 | +# Sprint SKILL.md line ~164 (CHECKPOINT 6/6) should use --reason |
| 56 | +_SPRINT_REASON="not_found" |
| 57 | +grep -q 'ticket transition.*closed.*--reason\|--reason.*Fixed' \ |
| 58 | + "$REPO_ROOT/plugins/dso/skills/sprint/SKILL.md" 2>/dev/null && _SPRINT_REASON="found" |
| 59 | +assert_eq "test_bug_close_uses_reason_flag_in_sprint" "found" "$_SPRINT_REASON" |
| 60 | + |
| 61 | +assert_pass_if_clean "test_bug_close_uses_reason_flag_in_sprint" |
| 62 | + |
| 63 | +# ============================================================================= |
| 64 | +print_summary |
0 commit comments