Files
dth/openspec/changes/chg_0003_dispatch_helpers/testcases.md
T
xstudio agentandClaude Opus 4.8 a94f40e42e merge sandbox/dd24a29: chg_0003 dispatch_helpers — A1 prep + A2 setup + A3 wait scripts (3 host tools, 8 cases, gate PASS)
- scripts/prep-sandbox-skills.sh: A1 host-side skill 拷贝 (跳过 symlink/template-boot-jnpf/JNPF_*)
- scripts/setup-xstudio-ai.sh: A2 host-side ai-config writer (python3 merge 不覆盖已有 providers)
- scripts/wait-for-task.sh: A3 host-side completion poller (轮询 /tmp/xstudio-sandbox/*/space/.xstudio-report.md)
- tests/e2e/dispatch_helpers.test.sh: 6 case 自检
- openspec/changes/chg_0003_dispatch_helpers/{5 工件}

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-09-28 11:18:36 +08:00

90 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
change_id: chg_0003
owner: qa@dth
status: draft
spec_ref: spec.md
---
# Testcases
## Cases
### C1_prep_copies_ai_collab_framework
- Scenario: S1
- Type: integration
- Priority: P0
- Given: ~/.claude/skills/ai-collab-framework 存在
- When: bash scripts/prep-sandbox-skills.sh <wsHash>
- Then: /tmp/xstudio-sandbox/<wsHash>/space/.claude/skills/ai-collab-framework/ 存在
- Automated: true
- Bound Task: T1
### C2_prep_skips_template_boot_jnpf
- Scenario: S1
- Type: integration
- Priority: P1
- Given: ~/.claude/skills/ssw-jnpf-lite-react/template-boot-jnpf 存在
- When: bash scripts/prep-sandbox-skills.sh <wsHash>
- Then: sandbox 空间内 .claude/skills/ssw-jnpf-lite-react/template-boot-jnpf 不存在(被显式 exclude)
- Automated: true
- Bound Task: T1
### C3_setup_writes_claude_process_provider
- Scenario: S2
- Type: integration
- Priority: P0
- Given: 任意 workspaceRoot;ANTHROPIC_AUTH_TOKEN 在 env 或 ~/ssw.ini
- When: bash scripts/setup-xstudio-ai.sh <workspaceRoot>
- Then: <workspaceRoot>/.xstudio/ai-config.json 的 .providers.claude-process.baseURL 非空,model 非空,authTokenEnv == "ANTHROPIC_AUTH_TOKEN"
- Automated: true
- Bound Task: T2
### C4_setup_preserves_existing_providers
- Scenario: S2
- Type: integration
- Priority: P1
- Given: workspaceRoot/.xstudio/ai-config.json 已有 anthropic-api provider
- When: bash scripts/setup-xstudio-ai.sh <workspaceRoot>
- Then: anthropic-api 段仍存在;claude-process 段是新加的(merged 不覆盖)
- Automated: true
- Bound Task: T2
### C5_wait_returns_when_report_appears
- Scenario: S3
- Type: integration
- Priority: P0
- Given: 某 wsHash,报告文件不在
- When: bash scripts/wait-for-task.sh fake-task 30,后台另一个进程在 5s 后创建 /tmp/xstudio-sandbox/<hash>/space/.xstudio-report.md
- Then: 脚本在 5s 内打印报告内容并 exit 0
- Automated: true
- Bound Task: T3
### C6_wait_times_out_when_report_missing
- Scenario: S4
- Type: integration
- Priority: P1
- Given: 报告文件永远不会出现
- When: bash scripts/wait-for-task.sh fake-task 3
- Then: 3s 后 exit 1,stderr 含 TIMEOUT
- Automated: true
- Bound Task: T3
### C7_test_runner_passes_all
- Scenario: S1, S2, S3, S4
- Type: e2e
- Priority: P0
- Given: 三个脚本 + 测试就位
- When: bash tests/e2e/dispatch_helpers.test.sh
- Then: exit 0
- Automated: true
- Bound Task: T4
### C8_check_spec_coverage_gap_zero
- Scenario: 全部
- Type: e2e
- Priority: P0
- Given: chg 工件齐备
- When: PROJECT_ROOT=. bash openspec/scripts/check_spec_coverage.sh
- Then: stdout 含 PASS 且 gap=0
- Automated: true
- Bound Task: T5