SuperAPI AI 工具集

dotnet-testing-orchestrator-aspire

测试与质量

查看项目

更新于 10-15 17:56

技能介绍

用途

這是一個 .NET Aspire 整合測試的 Orchestrator(指揮中心),職責是分析 Aspire AppHost 的 Resource 結構並調度測試流程,而不是自己直接撰寫測試程式碼。當使用者要求為 .NET Aspire 應用程式撰寫整合測試時使用此 skill。

它管轄一個 Aspire 測試 Skill:aspire-testing。透過 /dotnet-testing-orchestrator-aspire 載入 main thread context 後,使用自身的 Agent tool 調度四個 subagent:dotnet-testing-advanced-aspire-analyzer、dotnet-testing-advanced-aspire-writer、dotnet-testing-advanced-aspire-executor、dotnet-testing-advanced-aspire-reviewer。

與一般 Integration Orchestrator 的差異

  • 使用 DistributedApplicationTestingBuilder(非 WebApplicationFactory)
  • 使用 app.CreateHttpClient("servicename")(非 factory.CreateClient())
  • 容器管理由 Aspire AppHost 宣告式處理(非程式化 Testcontainers)
  • 單一 Skill(aspire-testing),Context Window 壓力最低

核心工作流程

流程為 Phase 0(清理)→ 階段 1~4(核心四階段)→ Phase 5(清理)。

  • Phase 0:使用 Glob 檢查測試專案目錄下是否有殘留的 .orchestrator/ 目錄;若有殘留則委託 Executor subagent 清理。
  • Phase 0.5:以 Bash 執行一次 token 計量起點標記(best-effort)。
  • 階段 1:啟動 dotnet-testing-advanced-aspire-analyzer 分析 Aspire AppHost 的 Resource 結構,產出結構化分析報告交接檔案(analysisFilePath)。
  • 階段 2:啟動 dotnet-testing-advanced-aspire-writer,依 Analyzer 交接檔案撰寫 Aspire 整合測試。
  • 階段 3:啟動 dotnet-testing-advanced-aspire-executor,建置並執行測試。
  • 階段 4:啟動 dotnet-testing-advanced-aspire-reviewer 審查測試品質(若 Executor 首次全數通過且使用者無品質審查需求,可略過)。
  • Phase 5:完成後委託 Executor 清理 .orchestrator/ 目錄。

使用方式與輸入

啟動 Analyzer 前,Orchestrator 只進行 Glob 殘留檢查、(必要時)清理與一次 best-effort 計量呼叫,不讀原始碼。使用者提供 API 專案路徑、AppHost 路徑、測試專案路徑、Controller 名稱即可。

傳給 Analyzer 的資訊包括:AppHost 專案路徑、被測試 API 專案路徑、目標 API 服務名稱(AppHost 中的 AddProject 名稱)、測試專案路徑、analysisOutputPath(格式為 {testProjectDir}/.orchestrator/analysis/{ControllerName}.analysis.json)、使用者特殊需求。

流程強調交接檔案路徑優先:傳遞 analysisFilePath、writerResultFilePath、executorResultFilePath 給 subagent,subagent 在 Step 0 自行讀取,不在 prompt 中嵌入完整分析 JSON 或 sourceCodeContext。

修改流程

當使用者要求套用 Reviewer 建議、修改既有 Aspire 測試或增加測試案例時,使用三階段修改流程:Aspire Writer(修改模式)→ Aspire Executor → Aspire Reviewer(re-review 模式)。

多目標支援

當一次指定多個 API 服務或多種測試場景時:Analyzer 平行、Writer 平行、Executor 循序(Aspire AppHost 啟動不可並行)、Reviewer 平行。

重要原則與限制

  • Aspire ≠ Integration:不使用 WebApplicationFactory,不使用 Testcontainers 程式化容器。
  • Resource 名稱一致性:CreateHttpClient("name") 的名稱必須與 AppHost 中 AddProject("name") 一致。
  • requiredSkills 固定使用 ["aspire-testing"]。
  • 環境檢查不可跳過:Docker 與 Aspire workload 兩項檢查在 Executor 階段完成。
  • Aspire 測試需啟動多個容器,Executor 必須使用長超時設定(10 分鐘以上)。
  • Docker 不可用或 Aspire workload 未安裝時,中止執行並提供修正指引(例如 dotnet workload install aspire)。
  • 所有輸出訊息、狀態更新、錯誤說明、摘要報告一律使用繁體中文。

輸出

結果會整合呈現測試檔案連結、執行結果摘要、Docker 與 Aspire 環境狀態、品質審查摘要、改善建議、使用的 Skills 組合、Executor 修正紀錄與各階段耗時;最後執行 token 用量統計並貼出其 Markdown 表格。

收費與平台

產品的收費、價格與支援平台等資訊,資料中暫未提供。