running
できること
このスキルは、ターミナルからGinkgoのテストを開始する方法と、使うべきオプションを説明します。Ginkgoツールでテストを実行する開発者向けです。
使う場面
- ✓ターミナルから、一つ以上のGinkgoのテストスイートを実行したいとき。
- ✓実行せずに、どのテストが動くかだけをプレビューしたいとき。
- ✓ランダムな順序で実行したり、問題を見つけるために繰り返したりしたいとき。
スキルのリンク
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/running/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のGoプロジェクトにあるGinkgoのテストをすべて実行し、どのテストが最初に動くか確認するにはどうすればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、ginkgoのコマンドとオプションを一覧にします。たとえば、テストのフォルダを実行する、プレビューする、ファイルの変更を監視するなどです。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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 {
よくある質問
代わりにgo testを使えますか?
使えますが、ginkgoコマンドは、go testにはない並列実行などの機能に対応しています。
テストに設定を渡すにはどうしますか?
二重のダッシュの後に置いたオプションは、テストプログラムそのものに渡されることをこのスキルは説明しています。
ウォッチモードは何をしますか?
ファイルが変わるとテストを自動的に再実行します。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 9.1k
- ランキング
- #12306
- ライセンス
- MIT
- 更新日
- 2026/10/9
コメント
- …
このリポジトリの他のスキル
ci
9.1kエージェントが、GinkgoのテストをCIで確実に動かせるよう設定を支援します。保留やフォーカスの取り残し、不安定なテストを見つける推奨フラグも含みます。
debugging-failures
9.1kエージェントが、要約の一行を読み、JSONレポートから失敗したテストとメッセージを取り出して、Ginkgoのテストが失敗した理由を見つけられるよう支援します。
decorators
9.1kエージェントが、Serial、Ordered、Label、Focus、タイムアウトなどのGinkgoのテストのデコレーターを、それぞれの働きを説明しながら正しく使えるよう支援します。
filtering
9.1kエージェントが、保留、スキップ、フォーカス、ラベル、バージョン条件、ファイルのフィルターを正しい優先順位で使い、Ginkgoのテストの一部だけを実行できるよう支援します。
似ているスキル
test-driven-development
311k機能や修正を作る前に、まず失敗するテストを書き、それが失敗するのを確認してから、合格させる最小のコードを書くようエージェントに教えます。
verification-before-completion
311kタスク、修正、ビルドが完了した、または合格したと主張する前に、実際のチェックを実行し、その出力を読むようエージェントに教えます。
migrate-to-shoehorn
310kテストファイル内の危険な型キャストを、shoehornライブラリに置き換え、テストが部分的なデータを使いつつ型チェックを通るようにします。