본문으로 건너뛰기
Skillpedia
테스트9.1k · #12298

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/ci/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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 committed Pending/PIt/XIt becomes 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/Focus exits non-zero — Ginkgo's built-in guard against shipping focus. Don't suppress it; fix it with ginkgo unfocus (→ ginkgo:filtering).

Collecting artifacts

Point reports and profiles at one directory and upload it as a build artifact:

  • --output-dir=.ginkgo-report collects the JSON report (and, under -r, merges all suites into one report.json) plus coverage/profiles into one place. → ginkgo:reporting for --keep-separate-reports and the other formats.
  • --junit-report=junit.xml additionally if your CI system renders JUnit — but keep --json-report as the source of truth; JUnit loses Ginkgo metadata.
  • An agent or human then diagnoses failures straight from report.json with jq → 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 (or GINKGO_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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬