Langsung ke konten
Skillpedia
Testing9.1k Β· #12306

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.md

Salin 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

Gunakan skill ini untuk membantu saya: https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/running/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

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 off GinkgoRandomSeed() 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-fast controls 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 -v compiles, builds the tree, and walks it honoring filters and dynamically generated specs β€” the most complete preview. --dry-run can't combine with -p/--procs; it runs in series. (ginkgo outline is faster but static, so it misses dynamic specs and filter/order effects.)
  • PreviewSpecs in place of RunSpecs returns a full Report (run specs β†’ SpecStatePassed, skipped β†’ SpecStateSkipped) for programmatic inspection. Pass it the same description+decorators you'd give RunSpecs:
    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

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa