ci
하는 일
이 스킬은 Go로 작성된 Ginkgo 테스트가 자동 빌드에서 안정적으로 실행되도록 설정합니다. 테스트 실행에서 실수를 잡아내고 결과를 분명하게 보고하려는 개발자를 위한 것입니다.
사용하는 경우
- ✓CI 파이프라인에 Ginkgo 테스트를 설정하고 있을 때.
- ✓Ginkgo 테스트가 내 컴퓨터에서는 통과하는데 CI에서는 다르게 동작할 때.
- ✓자동 실행에서 기계가 읽을 수 있는 테스트 보고서를 원할 때.
스킬 링크
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/ci/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 Go Ginkgo 테스트가 CI에서 권장 플래그와 JSON 보고서로 실행되도록 설정해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 Ginkgo 도구를 go run으로 실행해 프로젝트의 버전과 맞춥니다. 그리고 무작위 순서, 병렬 실행, 남은 pending이나 focus 표시가 있으면 실패하기, JSON 보고서 같은 플래그를 추가합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
Ginkgo를 go run으로 실행하는 이유는 무엇인가요?
go.mod 파일의 Ginkgo 버전과 도구 버전이 맞춰져서, 따로 설치하며 어긋날 일이 없기 때문입니다.
안전 점검은 무엇을 잡아내나요?
커밋된 focus나 pending 표시, 그리고 아무 테스트와도 맞지 않는 필터를 잡아냅니다. 이런 것들은 실패를 숨길 수 있습니다.
왜 테스트 순서를 무작위로 하나요?
무작위 순서는 실수로 서로 의존하는 테스트를 드러내는 데 도움이 됩니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 9.1k
- 순위
- #12298
- 라이선스
- MIT
- 업데이트
- 2026. 10. 9.
댓글
- …
이 저장소의 다른 스킬
debugging-failures
9.1k에이전트가 요약 줄을 읽고 JSON 보고서에서 실패한 정확한 테스트와 메시지를 꺼내서, Ginkgo 테스트가 왜 실패했는지 알아내도록 돕습니다.
decorators
9.1k에이전트가 Serial, Ordered, Label, Focus, 제한 시간 같은 Ginkgo 테스트 데코레이터를 바르게 쓰도록 각각의 역할을 설명해 돕습니다.
filtering
9.1k에이전트가 pending, skip, focus, 라벨, 버전 조건, 파일 필터를 올바른 우선순위에 따라 써서 Ginkgo 테스트의 일부만 실행하도록 돕습니다.
ordering-and-flakes
9.1k에이전트가 Ginkgo의 Serial 및 Ordered 설정과 재시도 옵션으로 Go 테스트의 순서를 관리하고 불안정한 테스트를 다루도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.