running
Fungsinya
Skill ini menjelaskan cara memulai tes Ginkgo dari baris perintah dan opsi mana yang sebaiknya dipakai. Skill ini ditujukan untuk pengembang yang menjalankan tes Go dengan alat Ginkgo.
Kapan dipakai
- βSaat Anda perlu menjalankan satu atau lebih rangkaian tes Ginkgo dari terminal.
- βSaat Anda ingin melihat tes mana yang akan berjalan tanpa benar-benar menjalankannya.
- βSaat Anda ingin menjalankan tes dalam urutan acak atau mengulangnya untuk menemukan masalah.
Link skill
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/running/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
βBagaimana cara menjalankan semua tes Ginkgo di proyek Go saya dan melihat mana yang akan berjalan lebih dulu?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill mendaftar perintah dan opsi ginkgo, seperti menjalankan sebuah folder tes, melihat pratinjau, atau memantau perubahan file.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Running Ginkgo
How to drive the suite once it's wired up (ginkgo:setup). For a production CI configuration, see ginkgo:ci. Docs: https://onsi.github.io/ginkgo/#ginkgo-cli-overview.
The CLI surface
ginkgo is the recommended runner β you can run suites with go test, but only the CLI does parallelism and profile aggregation, and a few go test flags (e.g. -count=N, use --repeat=N) are unsupported. ginkgo is shorthand for ginkgo run; it passes through nearly all go test/go build flags.
ginkgo # run the suite in the current directory
ginkgo path/to/suite path/to/other # run several named suites
ginkgo -r # recurse the tree, run every suite found (== ginkgo ./...)
ginkgo -p # run in parallel (β ginkgo:parallelism)
ginkgo -v --dry-run # build the tree and print what WOULD run, without running
ginkgo <GINKGO-FLAGS> <PACKAGES> -- <PASS-THROUGHS> # the full grammar
Ginkgo flags must come before the package list; suite-bound args go after --. Subcommands:
| Command | Does |
|---|---|
ginkgo build path/... |
Precompile each suite to a package.test binary (accepts a subset of run flags β compile-time only) |
ginkgo watch -r -p |
Re-run suites when they or their dependencies change (-depth tunes dependency monitoring) |
ginkgo bootstrap / ginkgo generate <subject> |
Scaffold a suite / a spec file (β ginkgo:setup); both take --template/--template-data |
ginkgo outline <file> |
Static (AST-parsed) spec outline as csv/indent/json β no compile needed |
ginkgo unfocus |
Strip all programmatic F-focus from the tree (β ginkgo:filtering) |
ginkgo labels |
List the Labels used in a suite (naive parse) |
ginkgo version |
Print the CLI version |
Precompiled binaries run via ginkgo package.test or ./package.test β but to run a precompiled suite in parallel you must go back through the CLI: ginkgo -p ./package.test. Cross-compile with the usual GOOS/GOARCH.
Randomization
Ginkgo randomizes spec order to surface spec pollution. By default it only shuffles top-level containers (specs within a container keep file order, easing debugging).
--randomize-allβ shuffle every spec. Use it in CI (βginkgo:ci).--randomize-suitesβ shuffle the order suites run in (multi-suite runs).--seed=Nβ pin the seed (printed near the top of every run) to reproduce a failing order exactly. Specs that generate randomness should seed offGinkgoRandomSeed()so the seed fully determines the run.
Randomization is only sound because Ginkgo assumes specs are independent (β ginkgo:overview); when ordering is genuinely required, use an Ordered container (β ginkgo:ordering-and-flakes), never definition order.
Running multiple suites
With -r or multiple package args, Ginkgo compiles suites in parallel but always runs them sequentially.
--compilers=Nβ number of parallel compile workers (default: one per core).--skip-package=a,b,cβ comma-separated; skips any suite whose path contains a listed substring (not compiled, not run).--keep-goingβ run all suites even after one fails (default stops after the first failed suite), to collect every failure. (--fail-fastcontrols stopping within a suite.)
You can also run several suites within one process by calling RunSpecs more than once, resetting Ginkgo's global state between calls with extensions/globals.Reset() (a niche orchestration escape hatch β your package-level state is not reset, only Ginkgo's).
Previewing specs
ginkgo --dry-run -vcompiles, builds the tree, and walks it honoring filters and dynamically generated specs β the most complete preview.--dry-runcan't combine with-p/--procs; it runs in series. (ginkgo outlineis faster but static, so it misses dynamic specs and filter/order effects.)PreviewSpecsin place ofRunSpecsreturns a fullReport(run specs βSpecStatePassed, skipped βSpecStateSkipped) for programmatic inspection. Pass it the same description+decorators you'd giveRunSpecs:func TestMySuite(t *testing.T) { if config, _ := GinkgoConfiguration(); config.DryRun { report := PreviewSpecs("My Suite", Label("suite-label")) _ = report // e.g. reporters.GenerateJUnitReport(report, "./preview.xml") } else {
Pertanyaan umum
Bisakah saya memakai go test saja?
Bisa, tetapi perintah ginkgo mendukung fitur seperti eksekusi paralel yang tidak ada di go test.
Bagaimana cara meneruskan pengaturan ke tes saya?
Skill menjelaskan bahwa opsi yang ditempatkan setelah tanda dua strip diteruskan langsung ke program tes.
Apa yang dilakukan mode watch?
Mode ini menjalankan ulang tes secara otomatis ketika file berubah.
Detail
Deskripsi asli dari pembuat
Run Ginkgo suites with the ginkgo CLI β run, -r, -p, --dry-run, watch, build (precompiled .test binaries), generate, outline, unfocus, labels, version; spec randomization (--randomize-all/--randomize-suites/--seed); running multiple suites (--keep-going/--skip-package/--compilers); previewing (--dry-run, PreviewSpecs); and parameterizing a suite via env vars or init()-registered flags after -- plus GinkgoConfiguration() overrides. Use when running suites locally, precompiling, watching for changes, or parameterizing a run from the command line. For a CI configuration see ginkgo:ci.
repo: onsi/ginkgo
Popularitas
- Bintang GitHub
- 9.1k
- Peringkat
- #12306
- Lisensi
- MIT
- Diperbarui
- 9/10/2026
Komentar
- β¦
Skill lain dari repositori ini
ci
9.1kMembantu agent Anda menyiapkan tes Ginkgo untuk integrasi berkelanjutan, dengan flag yang direkomendasikan untuk menangkap penanda fokus atau tertunda yang tertinggal serta tes yang tidak stabil.
debugging-failures
9.1kMembantu agent Anda mencari tahu mengapa tes Ginkgo gagal dengan membaca baris ringkasan dan mengambil tes yang gagal beserta pesannya dari laporan JSON.
decorators
9.1kMembantu agent Anda memakai dekorator tes Ginkgo dengan benar, seperti Serial, Ordered, Label, Focus, dan batas waktu, dengan menjelaskan fungsi masing-masing.
filtering
9.1kMembantu agent Anda menjalankan hanya sebagian tes Ginkgo, memakai pending, skip, focus, label, batasan versi, dan filter file sesuai urutan prioritasnya.
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.