compare-test-case
하는 일
이 스킬은 자동 테스트 하나를 두 브랜치에서 비교해 변경으로 테스트가 깨졌는지 알아봅니다. 테스트 회귀나 불안정한 테스트를 추적하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓기능 브랜치를 작업한 뒤 테스트가 실패하기 시작했을 때.
- ✓테스트가 불안정한지, 얼마나 자주 실패하는지 알고 싶을 때.
- ✓특정 테스트의 실패 내용을 조사해야 할 때.
스킬 링크
https://github.com/tuist/tuist/blob/main/skills/skills/compare-test-case/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“기능 브랜치의 LoginTests 테스트 케이스를 main과 비교해서 브랜치에서 왜 실패하는지 알려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트가 테스트 케이스를 찾고, 각 브랜치의 실행 목록을 살펴본 뒤, 통과와 실패 결과 및 시간을 비교하고, 실패한 실행의 세부 내용을 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Compare Test Case
Quick Start
You'll typically receive a test case identifier and two branches. Follow these steps:
- Run
tuist test case show <id-or-identifier> --jsonto get the test case metrics. - Run
tuist test case run list <identifier> --jsonto see runs across branches. - Compare behavior between base and head branches.
- Inspect failures with
tuist test case run show <run-id> --json. - Summarize findings with root cause analysis.
Step 1: Resolve the Test Case
By ID or dashboard URL
tuist test case show <test-case-id> --json
By identifier (Module/Suite/TestCase)
tuist test case show Module/Suite/TestCase --json
If no test case is provided
Discover flaky or failing tests to investigate:
tuist test case list --flaky --json --page-size 10
Key fields from the response:
id-- unique identifier for subsequent commandsname,module_name,suite_name-- the test identityreliability_rate-- percentage of successful runsflakiness_rate-- percentage of flaky runs in the last 30 daystotal_runs/failed_runs-- volume contextis_flaky/is_quarantined-- current flags
Step 2: Get Runs on Each Branch
List test case runs filtered by the test case, and look at the git_branch field:
tuist test case run list <identifier> --json --page-size 20
Separate runs by branch. For each branch, compute:
- Pass rate:
passed_runs / total_runs * 100 - Average duration
- Flaky run count
- Most recent status
Defaults
- If no base branch is provided, use the project's default branch (usually
main). - If no head branch is provided, detect the current git branch.
Step 3: Compare Branch Behavior
| Metric | Base branch | Head branch | Verdict |
|---|---|---|---|
| Pass rate | e.g. 100% | e.g. 60% | REGRESSION |
| Avg duration | e.g. 0.5s | e.g. 2.1s | REGRESSION |
| Flaky runs | 0 | 3 | NEW FLAKINESS |
| Last status | success | failure | REGRESSION |
Classify the change:
- Newly failing: 100% pass rate on base, <100% on head
- Newly flaky: No flaky runs on base, flaky runs on head
- Duration regression: >50% increase in average duration
- Fixed: Failing on base, passing on head
- Stable: Same behavior on both branches
Step 4: Inspect Failures
For each failing run on the head branch:
tuist test case run show <test-case-run-id> --json
Examine:
failures[].message-- the assertion or error messagefailures[].path-- source file pathfailures[].line_number-- exact line of failurefailures[].issue_type-- type of issuerepetitions-- shows retry behavior (e.g., pass-fail-pass means flaky)crash_report-- crash data if the test runner crashed
Step 5: Identify Root Cause
Based on the comparison:
Newly failing
- Check commits between base and head branches for changes to the test file or the code under test.
- Look at the failure message for clues about what changed.
Newly flaky
- Common patterns: timing/async issues, shared state, environment dependencies.
- Check if
repetitionsshow intermittent pass/fail patterns. - See the fix-flaky-tests skill for detailed flaky test analysis patterns.
Duration regression
- Check if setup/teardown time increased.
- Check if the test is doing more work (new assertions, larger data sets).
- Check if a dependency became slower.
Summary Format
Produce a summary with:
- Test case info: Name, module, suite, overall reliability.
- Base branch behavior: Pass rate, avg duration, flaky count.
- Head branch behavior: Pass rate, avg duration, flaky count.
- Verdict: What changed and classification.
- Root cause: Hypothesis based on failure analysis.
- Recommendations: Specific file paths, line numbers, and fix suggestions.
Example:
Test Case Comparison: AuthModuleTests/LoginTests/test_login_with_expired_token
Overall reliability: 85% (was 100% before head branch)
Base (main):
Pass rate: 100% (15/15 runs)
Avg duration: 0.3s
Flaky: No
Head (feature/auth-refactor):
Pass rate: 60% (3/5 runs)
Avg duration: 0.5s
Flaky: Yes (2 flaky runs)
Verdict: NEWLY FLAKY -- test was stable on main but intermittently fails on feature branch
Root cause: The auth refactor introduced an async token refresh that races with the
test's synchronous assertion. Failures show "Expected status 401, got nil" at
Tests/AuthModuleTests/LoginTests.swift:42, suggesting the res
자주 묻는 질문
불안정한 테스트도 찾을 수 있나요?
네. 불안정한 테스트 목록을 보여 주고, 신뢰도와 불안정 비율을 알려 줍니다.
테스트 케이스는 어떻게 찾나요?
ID나 모듈, 스위트, 테스트 이름으로 찾을 수 있습니다.
Tuist가 필요한가요?
네. Tuist 명령줄 도구로 테스트 케이스 데이터를 읽습니다.
상세 정보
작성자의 원본 설명
Compares a single test case's behavior across two branches, analyzing pass/fail status, duration, flakiness, and failure details. Useful for investigating test regressions introduced by a feature branch.
repo: tuist/tuist
인기도
- GitHub 스타
- 5.9k
- 순위
- #14542
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
analyze-selective-testing
5.9k에이전트가 Xcode 선택적 테스트의 건너뛰기 상태를 확인하고, 실행마다 건너뛰기가 달라진 이유를 찾도록 돕습니다.
compare-builds
5.9k에이전트가 두 Xcode 빌드 실행을 비교해 느려진 빌드, 캐시 사용의 변화, 새 문제를 찾도록 돕습니다.
compare-bundles
5.9k에이전트가 두 앱 번들을 비교해 크기 변화, 추가되거나 제거된 파일, 플랫폼 차이를 찾도록 돕습니다.
compare-cache-runs
5.9k에이전트가 두 캐시 실행을 비교해 캐시 적중률의 변화를 찾고, 캐시가 무효화된 이유를 설명하도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.