$npx -y skills add HOBOBO/AbilityKit --skill test-artifactsAbilityKit 测试产物管理规范——统一规划 moba headless / shooter StateSync multiprocess / dotnet test / Unity EditMode+PlayMode 四类测试的输出路径、命名、生命周期与清理。涵盖 tools/run_test_gate.ps1 + tools/test-gates.json 的 17 个 gate 体系、artifacts/headless/ 与 artifacts/test-gates/ 目录约定、.gitignore 覆盖范围、绕过 gate 体系直接跑命令
| 1 | # test-artifacts skill |
| 2 | |
| 3 | 基于源码核校(2026-07-20)。本 skill 规范 AbilityKit 所有测试产物的输出路径、命名、生命周期、清理与 gitignore 覆盖,覆盖 4 类测试: |
| 4 | |
| 5 | 1. **moba headless**(`MultiplayerHeadlessHeroReplacementCommand` 等 Unity executeMethod 无头测试) |
| 6 | 2. **shooter StateSync multiprocess**(`run_shooter_multiprocess_smoke.ps1` + Orleans 服务器) |
| 7 | 3. **dotnet test**(`AbilityKit.Demo.Moba.Tests` / `NetworkCondition.Tests` / `Shooter.Runtime.Tests` 等) |
| 8 | 4. **Unity EditMode / PlayMode**(`com.abilitykit.demo.moba.editor/Tests` 与 `view.runtime/Runtime/Game/Test/`) |
| 9 | |
| 10 | ## 核心原则 |
| 11 | |
| 12 | **所有测试产物必须落在 `artifacts/` 下,永远不要写在项目根**。 |
| 13 | |
| 14 | 历史教训:2026-07-20 之前,`MultiplayerHeadlessHeroReplacementCommand` 默认 resultPath 是 `../MultiplayerHeadlessHeroReplacement.xml`(相对 `Unity/` 即项目根),导致根目录累积了 24 个带 `-fix/-rerun/-probe/-diagnostic` 后缀的调试 XML 快照。已在 `artifacts/headless-archive/` 归档。 |
| 15 | |
| 16 | ## 产物目录总览(全部被 .gitignore 覆盖) |
| 17 | |
| 18 | ``` |
| 19 | artifacts/ |
| 20 | ├── test-gates/ ← gate 体系输出(推荐入口) |
| 21 | │ └── {yyyyMMdd-HHmmss}-{Gate}/ ← 每次运行一个目录 |
| 22 | │ ├── gate-summary.json ← gate 总结 |
| 23 | │ ├── 01-{StepName}.log ← 每个 step 的日志 |
| 24 | │ ├── test-results/ ← dotnet test TRX |
| 25 | │ │ └── 01-{StepName}.trx |
| 26 | │ └── unity-results/ ← Unity 测试 NUnit XML + log + command.txt |
| 27 | │ ├── {StepName}.xml |
| 28 | │ ├── {StepName}.log |
| 29 | │ └── {StepName}.command.txt |
| 30 | ├── headless/ ← 不走 gate 的 ad-hoc 无头测试 |
| 31 | │ └── MultiplayerHeadlessHeroReplacement-{yyyyMMdd-HHmmss}.xml |
| 32 | ├── headless-archive/ ← 历史归档(2026-07-20 前根目录残留) |
| 33 | │ └── MultiplayerHeadlessHeroReplacement-*.xml (24 个) |
| 34 | ├── test-gates/contract-validation/ ← validate_shooter_test_gates.ps1 输出 |
| 35 | │ └── report.json |
| 36 | └── gateway-build-validation/ ← Server/Orleans 子项目构建产物 |
| 37 | ``` |
| 38 | |
| 39 | ## .gitignore 覆盖 |
| 40 | |
| 41 | ``` |
| 42 | **/*.log |
| 43 | **/artifacts/ |
| 44 | **/TestResults/ |
| 45 | ``` |
| 46 | |
| 47 | 这三条覆盖了所有测试产物路径(dotnet 默认 `TestResults/` + 项目自定义 `artifacts/`)。 |
| 48 | |
| 49 | ## Sections |
| 50 | |
| 51 | - [when_to_use.md](when_to_use.md) — 何时启用本 skill |
| 52 | - [gate_runner.md](gate_runner.md) — `run_test_gate.ps1` + `test-gates.json` 17 gate 体系(推荐入口) |
| 53 | - [dotnet_test.md](dotnet_test.md) — dotnet test 直接跑的产物(TRX + TestResults/) |
| 54 | - [unity_editmode_playmode.md](unity_editmode_playmode.md) — Unity EditMode/PlayMode 测试产物(NUnit XML + Editor Tests) |
| 55 | - [moba_headless.md](moba_headless.md) — MultiplayerHeadlessHeroReplacementCommand 等无头测试 |
| 56 | - [shooter_state_sync.md](shooter_state_sync.md) — shooter multiprocess + StateSync + restart_shooter_state_sync.bat |
| 57 | - [ad_hoc_workflows.md](ad_hoc_workflows.md) — 绕过 gate 体系的注意事项 + 清理策略 |
| 58 | - [ci_integration.md](ci_integration.md) — .github/workflows/abilitykit-test-gates.yml + actions/upload-artifact |
| 59 | |
| 60 | ## 相关 skill |
| 61 | |
| 62 | - moba demo 测试体系 → [moba-demo](../moba-demo/SKILL.md)(含 4 套测试清单) |
| 63 | - shooter demo 测试体系 → [shooter-demo](../shooter-demo/SKILL.md)(含 AcceptanceSpecs / PlayMode) |
| 64 | - 帧同步测试 → [framesync-prediction-rollback](../framesync-prediction-rollback/SKILL.md) |