- 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]>
90 lines
2.6 KiB
Markdown
90 lines
2.6 KiB
Markdown
---
|
||
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 |