fix-flaky-tests by tuist/agent-skills
npx skills add https://github.com/tuist/agent-skills --skill fix-flaky-tests你通常会收到一个 Tuist 测试用例 URL 或标识符。请按照以下步骤进行调查和修复:
tuist test case show <id-or-identifier> --json 以获取测试的可靠性指标。tuist test case run list Module/Suite/TestCase --flaky --json 以查看不稳定的运行模式。tuist test case run show <run-id> --json,以获取失败信息和文件路径。你可以传递 UUID 或 Module/Suite/TestCase 标识符:
tuist test case show <id> --json
tuist test case show Module/Suite/TestCase --json
关键字段:
reliability_rate — 成功运行的百分比(越高越好)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
flakiness_rate — 过去 30 天内标记为不稳定的运行百分比total_runs / failed_runs — 运行量上下文last_status — 当前状态tuist test case run list Module/Suite/TestCase --flaky --json
标识符使用格式 ModuleName/SuiteName/TestCaseName,或者在没有套件时使用 ModuleName/TestCaseName。此命令仅返回被检测为不稳定的运行。
tuist test case run list Module/Suite/TestCase --json --page-size 20
寻找模式:
is_ci: true)上失败,还是在本地也失败?tuist test case run show <run-id> --json
关键字段:
failures[].message — 断言或错误信息failures[].path — 源文件路径failures[].line_number — 失败的确切行号failures[].issue_type — 问题类型(assertion_failure 等)repetitions — 如果存在,显示重试行为(通过/失败序列)test_run_id — 此执行所属的更广泛的测试运行failures[0].path 处的文件,并跳转到 failures[0].line_number。await、带超时的期望或轮询。sleep(1) 或固定的延迟在 CI 上太短。修复:使用基于条件的等待而不是固定延迟。识别模式后:
使用 xcodebuild 内置的重复支持,重复运行特定测试直到失败:
xcodebuild test -workspace <workspace> -scheme <scheme> -only-testing <module>/<suite>/<test> -test-iterations <count> -run-tests-until-failure
这将运行测试最多 <count> 次,并在第一次失败时停止。根据测试所需时间选择迭代次数——对于快速的单元测试使用 50–100 次,对于较慢的集成或验收测试使用 2–5 次。
每周安装量
158
仓库
GitHub 星标
28
首次出现
2026年2月11日
安全审计
安装于
codex138
github-copilot134
gemini-cli132
opencode132
amp132
kimi-cli131
You'll typically receive a Tuist test case URL or identifier. Follow these steps to investigate and fix it:
tuist test case show <id-or-identifier> --json to get reliability metrics for the test.tuist test case run list Module/Suite/TestCase --flaky --json to see flaky run patterns.tuist test case run show <run-id> --json on failing flaky runs to get failure messages and file paths.You can pass either the UUID or the Module/Suite/TestCase identifier:
tuist test case show <id> --json
tuist test case show Module/Suite/TestCase --json
Key fields:
reliability_rate — percentage of successful runs (higher is better)flakiness_rate — percentage of runs marked flaky in the last 30 daystotal_runs / failed_runs — volume contextlast_status — current statetuist test case run list Module/Suite/TestCase --flaky --json
The identifier uses the format ModuleName/SuiteName/TestCaseName or ModuleName/TestCaseName when there is no suite. This returns only runs that were detected as flaky.
tuist test case run list Module/Suite/TestCase --json --page-size 20
Look for patterns:
is_ci: true) or also locally?tuist test case run show <run-id> --json
Key fields:
failures[].message — the assertion or error messagefailures[].path — source file pathfailures[].line_number — exact line of failurefailures[].issue_type — type of issue (assertion_failure, etc.)repetitions — if present, shows retry behavior (pass/fail sequence)test_run_id — the broader test run this execution belongs tofailures[0].path and go to failures[0].line_number.await, expectations with timeouts, or polling.sleep(1) or fixed delays that are too short on CI. Fix: use condition-based waits instead of fixed delays.After identifying the pattern:
Run the specific test repeatedly until failure using xcodebuild's built-in repetition support:
xcodebuild test -workspace <workspace> -scheme <scheme> -only-testing <module>/<suite>/<test> -test-iterations <count> -run-tests-until-failure
This runs the test up to <count> times and stops at the first failure. Choose the iteration count based on how long the test takes — for fast unit tests use 50–100, for slower integration or acceptance tests use 2–5.
Weekly Installs
158
Repository
GitHub Stars
28
First Seen
Feb 11, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex138
github-copilot134
gemini-cli132
opencode132
amp132
kimi-cli131
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
33,600 周安装