ci
What it does
This skill sets up Go tests written with Ginkgo so they run reliably in automated builds. It is for developers who want their CI runs to catch mistakes and report results clearly.
When to use it
- βWhen you are setting up Ginkgo tests in a CI pipeline.
- βWhen a Ginkgo test run passes on your computer but behaves differently in CI.
- βWhen you want machine-readable test reports from automated runs.
Skill link
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/ci/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up my Go Ginkgo tests to run in CI with the recommended flags and a JSON report.β
5 new skills a week. 1 minute to read.
How it works
The agent runs the Ginkgo tool through go run so its version matches your project, and adds flags for random order, parallel runs, failing on leftover pending or focus marks, and a JSON report.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Ginkgo in CI
A CI invocation should maximize signal β surface flakes and spec pollution, catch mistakes that pass locally, and emit machine-readable artifacts β while collecting every failure in one run. This builds on the CLI (ginkgo:running) and report formats (ginkgo:reporting). Full rationale: https://onsi.github.io/ginkgo/#recommended-continuous-integration-configuration.
The recommended flag set
Invoke via go run so the CLI version always tracks the github.com/onsi/ginkgo/v2 in your go.mod β no separately-installed binary to drift (β ginkgo:setup).
go run github.com/onsi/ginkgo/v2/ginkgo \
-r -p --randomize-all --randomize-suites \
--fail-on-pending --fail-on-empty --keep-going \
--cover --coverprofile=cover.profile --race --trace \
--json-report=report.json --output-dir=.ginkgo-report \
--timeout=TIMEOUT --poll-progress-after=Xs --poll-progress-interval=Ys
| Flag | Why |
|---|---|
-r |
recursively find and run every suite |
-p |
run each suite in parallel (β ginkgo:parallelism; set --procs=N/--compilers=N if CPU detection is wrong) |
--randomize-all / --randomize-suites |
shuffle all specs and the suite order to surface spec pollution (β ginkgo:running) |
--fail-on-pending |
fail if any Pending specs were committed |
--fail-on-empty |
fail if no specs ran (usually a malformed filter) |
--keep-going |
don't stop at the first failed suite β collect all failures |
--cover --coverprofile=cover.profile |
compute coverage into one merged profile (β ginkgo:reporting) |
--race |
run with the race detector (costs a fixed ~1s per suite β see below) |
--trace |
full stack traces on failure (worth it without a local feedback loop) |
--json-report=report.json |
structured results for diagnosis and downstream tools (β ginkgo:debugging-failures) |
--timeout=TIMEOUT |
cap the whole run (default 1h β often not enough) |
--poll-progress-after/--poll-progress-interval |
emit progress reports for stuck specs (β ginkgo:timeouts-and-async) |
The exit-code safeguards β CI's real value
Three flags turn "looks green" into "is actually trustworthy." They make CI fail on mistakes that pass silently on a developer's machine:
--fail-on-pendingβ a committedPending/PIt/XItbecomes a CI failure, so dev-time placeholders can't rot into the suite.--fail-on-emptyβ a typo'd--label-filter(or an over-aggressive--skip) that selects zero specs fails instead of falsely passing.- Committed programmatic focus already fails CI for free. A passing suite that contains
FIt/FDescribe/Focusexits non-zero β Ginkgo's built-in guard against shipping focus. Don't suppress it; fix it withginkgo unfocus(βginkgo:filtering).
Collecting artifacts
Point reports and profiles at one directory and upload it as a build artifact:
--output-dir=.ginkgo-reportcollects the JSON report (and, under-r, merges all suites into onereport.json) plus coverage/profiles into one place. βginkgo:reportingfor--keep-separate-reportsand the other formats.--junit-report=junit.xmladditionally if your CI system renders JUnit β but keep--json-reportas the source of truth; JUnit loses Ginkgo metadata.- An agent or human then diagnoses failures straight from
report.jsonwithjqβginkgo:debugging-failures.
CI-friendly console output
--github-outputβ formats the console log for GitHub Actions readability (grouped, annotated).--force-newlinesβ flush output line-by-line for CI systems that only flush on newline.--no-color(orGINKGO_NO_COLOR=TRUE) β drop ANSI codes from logs that don't render them.
The race detector's fixed per-suite cost
--race adds about a second to every suite, no matter how few specs it has. ThreadSanitizer sleeps for one second at process exit (atexit_sleep_ms, its default) so that races reported by goroutines still running at exit aren't lost, and Ginkgo has to wait for the processes it spawned. Under -r -p that lands in the gap between suites, where it looks exactly like compilation.
The tell is that it's flat across package size β a 2-spec package pays the same as a 2000-spec package. A build cost can't behave that way; a per-process cost must. If you're auditing a slow race-enabled run, measure with precompiled binaries (ginkgo build -r) so compilation is excluded by construction rather than by
FAQ
Why run Ginkgo through go run?
It keeps the Ginkgo tool version in step with the one in your go.mod file, so there is no separate install to drift.
What do the safety checks catch?
Committed focus or pending markers and filters that match no tests, which could otherwise hide failures.
Why randomize the test order?
Random order helps surface tests that depend on each other by accident.
Details
Original description by the author
Configure Ginkgo for continuous integration β the recommended CLI flag set and the rationale for each flag (-r -p --randomize-all --randomize-suites --fail-on-pending --fail-on-empty --keep-going --cover --race --trace --json-report --timeout --poll-progress-after/-interval), invoking via go run to pin the CLI to go.mod, the exit-code safeguards that catch committed Focus/Pending and empty filters, collecting report and coverage artifacts with --output-dir, CI-friendly output (--github-output/--force-newlines/--no-color), and the fixed per-suite cost --race adds (GORACE=atexit_sleep_ms=0). Use
repo: onsi/ginkgo
Popularity
- GitHub stars
- 9.1k
- Ranking position
- #12298
- License
- MIT
- Updated
- 10/9/2026
Comments
- β¦
More skills from this repository
debugging-failures
9.1kHelps your agent find out why Ginkgo tests failed by reading the summary line and pulling the exact failing tests and messages from a JSON report.
decorators
9.1kHelps your agent use Ginkgo test decorators correctly, such as Serial, Ordered, Label, Focus and timeouts, by explaining what each one does.
filtering
9.1kHelps your agent run only some Ginkgo tests, using pending, skip, focus, labels, version constraints and file filters in the right order of precedence.
ordering-and-flakes
9.1kHelps your agent control the order of Go tests and handle flaky ones, using Ginkgo's Serial and Ordered settings and retry options.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.