analyze-selective-testing
Fungsinya
Skill ini menganalisis run tes Xcode di Tuist untuk melihat target tes mana yang dilewati atau dijalankan. Skill ini untuk pengembang iOS dan macOS yang menginginkan run tes lebih cepat tanpa melewatkan tes.
Kapan dipakai
- βSaat Anda ingin tahu target tes mana yang dilewati Xcode dalam sebuah run tes.
- βSaat seleksi tes tampak memburuk dan Anda ingin mencari penyebabnya.
- βSaat Anda ingin membandingkan dua run tes untuk melihat apa yang berubah.
Link skill
https://github.com/tuist/tuist/blob/main/skills/skills/analyze-selective-testing/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βPeriksa target tes mana yang dilewati pada run tes terakhir saya di cabang ini dan mengapa pelewatannya berkurang.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent mendaftar run tes terbaru dengan alat baris perintah Tuist, membaca status selective testing setiap target, dan membandingkan run saat regresi dicurigai.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Analyze Selective Testing
Quick Start
- Run
tuist test list --jsonto find test runs. - Run
tuist test xcode target list <test-run-id> --jsonto see per-target selective testing status. - If effectiveness dropped, compare targets between a known-good run and the regressed run.
Step 1: Resolve Test Runs
Find the test run to analyze
List recent test runs, optionally filtering by branch:
tuist test list --json --page-size 10
tuist test list --git-branch feature-x --json --page-size 5
Get basic info for a specific test run:
tuist test show <test-run-id> --json
Use this to confirm the run's branch, status, scheme, and environment (xcode_version, macos_version).
Defaults
- If no test run is specified, use the most recent CI test run on the current branch.
- For comparison, use the most recent CI test run on the project's default branch.
Step 2: Drill Into Selective Testing Targets
List per-target selective testing data for a test run:
tuist test xcode target list <test-run-id> --json
Each target includes:
- name: The test target name
- hit_status:
miss(ran),local(skipped via local cache), orremote(skipped via remote cache) - hash: The selective testing hash for this target
Filter by status to focus your analysis:
tuist test xcode target list <test-run-id> --hit-status miss --json
tuist test xcode target list <test-run-id> --hit-status local --json
tuist test xcode target list <test-run-id> --hit-status remote --json
Assess effectiveness
Count the targets by status:
effectiveness = (local_hits + remote_hits) / total_targets * 100
| Effectiveness | Verdict |
|---|---|
| 60-100% | Healthy β most unchanged tests are being skipped |
| 30-60% | Moderate β some cache invalidation occurring, worth investigating |
| 0-30% | Low β likely a core dependency changed or the cache was invalidated |
| 0% | Cold cache β first run, environment change, or full invalidation |
Step 3: Diagnose Regressions
If effectiveness dropped, investigate:
Check for global invalidation
If nearly all targets show as miss, the entire selective testing cache was invalidated. Common causes:
| Cause | How to verify |
|---|---|
| Xcode version change | Compare xcode_version between good and bad runs via tuist test show |
| CI environment change | Compare macos_version, model_identifier between runs |
| Project graph or dependency change | Check git history for changes to project manifests, dependency versions, or target configurations |
| Core dependency change | A widely-depended-on target changed, invalidating all its dependents |
Note: Tuist CLI version upgrades rarely cause hash invalidation β the hash version is not updated on every release.
Check for cascade invalidation
If only some targets show as miss, a dependency change likely cascaded:
- Run
tuist test xcode target list <good-run-id> --jsonandtuist test xcode target list <bad-run-id> --json. - Match targets by name β identify those that changed from
local/remotetomiss. - Compare hashes for changed targets β if a target's hash differs, its sources or dependencies changed.
- Look for a common dependency among the invalidated targets.
Compare two test runs
For each target:
- Match by
name - Compare
hit_status(hit -> miss = invalidated, miss -> hit = improved) - Compare
hash(different hash = target or its dependencies changed)
Step 4: Recommendations
Based on the diagnosis:
- Environment change: Ensure CI uses consistent Xcode/macOS versions. This is the most common cause of full cache invalidation.
- Cascade from dependency change: Consider if the change to the root target was necessary. If the root target is a widely-shared module, consider splitting it.
- Cold cache on new branch: Run tests once to warm the cache. Subsequent runs will benefit from selective testing.
Summary Format
Produce a summary with:
- Overall: effectiveness percentage, verdict (healthy/moderate/low/cold)
- Target breakdown: targets grouped by hit status
- Comparison (if applicable): targets that changed status between runs, with hash diffs
- Root cause: what caused the regression
- Recommendations: actionable next steps
Example:
Selective Testing Analysis: test run abc123 on feature-x
Effectiveness: 15% (3/20 targets skipped) -- LOW
Local hits: 2 targets (CoreTests, UtilTests)
Pertanyaan umum
Apakah perlu Tuist?
Ya. Skill memakai alat baris perintah Tuist untuk membaca data run tes.
Apa arti target yang dilewati?
Artinya target tidak dijalankan karena tidak berubah, baik dari cache lokal maupun cache jarak jauh.
Bisakah membandingkan dua run?
Bisa. Skill dapat membandingkan run yang diketahui baik dengan run yang mengalami regresi.
Detail
Deskripsi asli dari pembuat
Analyzes Xcode selective testing effectiveness for a test run, showing which test targets were skipped or ran, and diagnosing regressions in test selection. Can compare two test runs to identify what changed.
repo: tuist/tuist
Popularitas
- Bintang GitHub
- 5.9k
- Peringkat
- #14536
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
compare-builds
5.9kMembantu agent Anda membandingkan dua run build Xcode untuk menemukan build yang lebih lambat, perubahan penggunaan cache, dan masalah baru.
compare-bundles
5.9kMembantu agent Anda membandingkan dua bundle aplikasi untuk menemukan perubahan ukuran, file yang ditambahkan atau dihapus, dan perbedaan antar platform.
compare-cache-runs
5.9kMembantu agent Anda membandingkan dua run cache untuk menemukan perubahan tingkat cache hit dan menjelaskan mengapa cache dibatalkan.
compare-generations
5.9kMembantu agent Anda membandingkan dua run generasi proyek Tuist untuk menemukan perubahan cache hit dan penyebab cache dibatalkan.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.