SuperAPI AI 工具集

ci-test-failures

测试与质量

查看项目

更新于 10-16 00:30

技能介绍

用途:诊断 GitHub Actions 测试失败,下载失败作业日志与测试产物,并创建或更新失败测试 Issue。

主要能力:DownloadFailingJobLogs.cs 可下载失败作业日志与 .trx 等测试产物;CreateFailingTestIssue 可从 PR/运行/作业 URL 解析失败测试并创建或更新 Issue;/create-issue 工作流可从 Issue 或 PR 评论触发创建、重开或评论失败测试 Issue。

使用方式:先获取 run ID,例如 gh run list --repo microsoft/aspire --branch <branch-name> --limit 1 --json databaseId --jq '.[0].databaseId';再运行 cd tools/scripts 与 dotnet run DownloadFailingJobLogs.cs -- <run-id>。创建 Issue 时使用 dotnet run --project tools/CreateFailingTestIssue -- --url "<url>" --test "<test-name>" --create --output /tmp/cfti-result.json,并用 jq 读取结果。也可在 PR 或 Issue 评论中使用 /create-issue --test "<test-name>" [--url <pr|run|job-url>] [--workflow <selector>] [--force-new]。

适用场景:排查 CI 失败、定位失败测试、按模板生成失败测试 Issue。

限制:需仓库写或管理员权限;不要用 gh issue create 手动创建,也不要自行编写 Issue Markdown;始终用 --output 写文件,避免解析 stdout;工具失败时报告 diagnostics.log 与 JSON 错误,不要回退到手动创建。部分细节暂未提供。