返回 Skill 列表
extension
分类: 开发与工程无需 API Key

test-resolve-review

针对/resolve-review技能的集成测试。创建测试数据,指导手动测试,验证结果。

person作者: jakexiaohubgithub

Test resolve-review

Integration test for the resolve-review skill with preset fixtures.

Usage

/test-resolve-review

Flow

  1. Setup - Creates branch, PR, review threads, and PR comments
  2. Manual execution - User runs /resolve-review --self --pr=<N>
  3. Verify - Checks thread resolution, comment minimization, commits, summary
  4. Cleanup - Closes PR, deletes branch

Instructions

Phase 1: Setup

Run the setup script:

SETUP_OUTPUT=$(plugins/pr/skills/test-resolve-review/scripts/setup-test-pr.sh)
PR_NUMBER=$(echo "$SETUP_OUTPUT" | jq -r '.pr_number')
BRANCH=$(echo "$SETUP_OUTPUT" | jq -r '.branch')

Create the tmp directory and write execution guide to .claude/tmp/test-resolve-review-guide.md:

mkdir -p .claude/tmp
# Test Execution Guide

## Start Prompt
Select both:
- ☑ Post summary comment
- ☑ Push commits

## Items

| Item | Description | Action |
|------|-------------|--------|
| 1+2 | "null check" threads (grouped) | ADDRESS |
| 3 | "Complex refactor needed" | **DEFER** |
| 4 | "Add loading state" (PR comment) | ADDRESS |
| 5a | "Fix error handling" (part 1/3) | ADDRESS |
| 5b | "Also add types" (part 2/3) | ADDRESS |
| 5c | "And tests" (part 3/3) | ADDRESS |

## Command
\`\`\`
/resolve-review --self --pr=$PR_NUMBER
\`\`\`

## When Done
Return here and say "verify"

Display:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST: resolve-review integration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Setting up test fixtures...
  ✓ Created branch: $BRANCH
  ✓ Created test-fixture-file.ts
  ✓ Opened PR #$PR_NUMBER
  ✓ Added 3 review threads
  ✓ Added 2 PR comments

Guide written to: .claude/tmp/test-resolve-review-guide.md

Run: /resolve-review --self --pr=$PR_NUMBER

When done, say "verify" to check results.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Wait for user to complete manual testing and say "verify".

Phase 2: Verify

When user says "verify", run verification:

VERIFY_OUTPUT=$(plugins/pr/skills/test-resolve-review/scripts/verify-test-pr.sh --pr="$PR_NUMBER")
PASSED=$(echo "$VERIFY_OUTPUT" | jq -r '.passed')

Display results:

Verifying test results...

For each assertion in output, display:

  • if passed
  • if failed

If all passed:

All assertions passed! Cleanup? [Yes / Keep for inspection]

If any failed:

Some assertions failed. Cleanup? [Yes / Keep for inspection]

Phase 3: Cleanup

If user confirms cleanup:

plugins/pr/skills/test-resolve-review/scripts/cleanup-test-pr.sh --pr="$PR_NUMBER" --branch="$BRANCH"

Display:

Cleanup complete. Test session ended.

If user wants to keep for inspection:

Keeping PR #$PR_NUMBER and branch $BRANCH for inspection.
Run cleanup manually when done:
  gh pr close $PR_NUMBER --delete-branch

Test Fixtures

| # | Type | Content | Expected Action | |---|------|---------|-----------------| | 1 | Thread | "Add null check before accessing user.name" | Address | | 2 | Thread | "Also needs null check here" | Address (group with 1) | | 3 | Thread | "This needs refactoring - significant rework" | Defer | | 4 | PR Comment | "Add loading state while fetching" | Address | | 5 | PR Comment | "Fix error handling. Also add types. And tests." | Address (3 parts) |

Assertions

  • Threads 1, 2: resolved
  • Thread 3: still open (deferred)
  • Comments 4, 5: minimized
  • At least 4 commits created
  • Summary comment posted with "Feedback Summary" section