본문으로 건너뛰기
Skillpedia
테스트5.9k · #14542

compare-test-case

하는 일

이 스킬은 자동 테스트 하나를 두 브랜치에서 비교해 변경으로 테스트가 깨졌는지 알아봅니다. 테스트 회귀나 불안정한 테스트를 추적하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓기능 브랜치를 작업한 뒤 테스트가 실패하기 시작했을 때.
  • ✓테스트가 불안정한지, 얼마나 자주 실패하는지 알고 싶을 때.
  • ✓특정 테스트의 실패 내용을 조사해야 할 때.

스킬 링크

https://github.com/tuist/tuist/blob/main/skills/skills/compare-test-case/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/tuist/tuist/blob/main/skills/skills/compare-test-case/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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:

  1. Run tuist test case show <id-or-identifier> --json to get the test case metrics.
  2. Run tuist test case run list <identifier> --json to see runs across branches.
  3. Compare behavior between base and head branches.
  4. Inspect failures with tuist test case run show <run-id> --json.
  5. 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 commands
  • name, module_name, suite_name -- the test identity
  • reliability_rate -- percentage of successful runs
  • flakiness_rate -- percentage of flaky runs in the last 30 days
  • total_runs / failed_runs -- volume context
  • is_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 message
  • failures[].path -- source file path
  • failures[].line_number -- exact line of failure
  • failures[].issue_type -- type of issue
  • repetitions -- 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 repetitions show 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:

  1. Test case info: Name, module, suite, overall reliability.
  2. Base branch behavior: Pass rate, avg duration, flaky count.
  3. Head branch behavior: Pass rate, avg duration, flaky count.
  4. Verdict: What changed and classification.
  5. Root cause: Hypothesis based on failure analysis.
  6. 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬