reporting
하는 일
이 스킬은 Ginkgo 테스트 결과가 어떻게 보이는지 조정하고, 이를 기계가 읽을 수 있는 보고서로 저장하는 방법을 설명합니다. 명확한 테스트 출력이나 다른 도구용 보고서를 원하는 개발자를 위한 것입니다.
사용하는 경우
- ✓화면에 보이는 테스트 결과의 세부 수준을 늘리거나 줄이고 싶을 때.
- ✓Ginkgo 테스트에서 JSON이나 JUnit 보고서 파일이 필요할 때.
- ✓Go 테스트의 코드 커버리지나 성능을 확인하고 싶을 때.
스킬 링크
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/reporting/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Go 테스트가 JUnit 보고서를 저장하게 해 주세요. CI 시스템이 읽을 수 있어야 합니다.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 자세한 출력을 보여 주고, 보고서 파일을 쓰고, 커버리지나 속도를 측정하는 명령 옵션을 보여 줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Reporting and profiling
How to produce reports and feed data into them. To read a failing report as an agent (the jq failure-diagnosis workflow), see ginkgo:debugging-failures. Docs: https://onsi.github.io/ginkgo/#generating-machine-readable-reports and https://onsi.github.io/ginkgo/#attaching-data-to-reports.
Console output
| Flag | Effect |
|---|---|
--succinct |
Minimal (default when running multiple suites). |
| (none) | Normal — detail only for failed specs (default, single suite). |
-v |
Full timeline for every spec; streams live in series. |
-vv |
-v plus node > Enter/< Exit events and every failure (not just the primary). |
--trace |
Full stack trace on every failure, not just panics. |
--no-color / GINKGO_NO_COLOR=TRUE |
Disable color. |
--github-output |
Format console output for GitHub Actions. |
In parallel (-p), -v/-vv timelines can't stream — the streams would interleave, so Ginkgo emits each spec's full timeline after that spec completes. → CI flags in ginkgo:ci.
Machine-readable reports
ginkgo -r --json-report=report.json --output-dir=./.reports
--json-reportis native and richest — an array oftypes.Report, each withSpecReports[]oftypes.SpecReport(godoc); build tooling against thetypespackage.--junit-report=x.xml,--teamcity-report=x,--gojson-report=x.go.jsonexist for external CI but lose Ginkgo metadata — use them to feed a system, not to diagnose. (JUnit maps aLabel("owner:XYZ")to theOwnerattribute.)--output-dir=DIRcollects all files in one place; under-rall suites merge into one report file.--keep-separate-reportswrites onePACKAGE_report.jsonper package instead.- Every machine-readable report embeds the full
-vvtimeline regardless of console verbosity. Run the suite quiet and mine the file — you don't need-vvon the console to get rich detail in the report.
Programmatic reporting nodes
CurrentSpecReport() works in any run-phase closure — use it for in-spec conditional diagnostics:
AfterEach(func() {
if CurrentSpecReport().Failed() {
GinkgoWriter.Println(libraryClient.DebugLogs()) // expensive diagnostics, only on failure
}
})
For custom report files, don't roll your own in AfterEach — use reporting nodes:
ReportAfterEach(func(r SpecReport){...})/ReportBeforeEach— run for every spec including skipped/pending (unlikeAfterEach), after allAfterEaches. A failure here fails the spec. In parallel they run on each process concurrently — never write a shared file from them (you'll get interleaved garbage).ReportBeforeSuite/ReportAfterSuite("name", func(r Report){...})— top-level, and run only on process #1.ReportAfterSuitereceives theReportaggregated across all parallel processes — this is the safe place for custom suite-level report files:
ReportAfterSuite("custom report", func(report Report) {
f, _ := os.Create("report.custom")
for _, sr := range report.SpecReports {
fmt.Fprintf(f, "%s | %s\n", sr.FullText(), sr.State)
}
f.Close()
})
Reporting nodes can be made interruptible by also accepting SpecContext → ginkgo:timeouts-and-async.
Attaching data to a spec: AddReportEntry
It("is reported", func() {
AddReportEntry("Publish stats", stats, ReportEntryVisibilityFailureOrVerbose)
})
AddReportEntry(name, value, ...args) attaches arbitrary data to the current spec; it lands in SpecReport.ReportEntries, in all machine-readable reports, and (per visibility) on the console. Visibility enum:
ReportEntryVisibilityAlways(default) — always printed.ReportEntryVisibilityFailureOrVerbose— only on failure or-v(likeGinkgoWriter).ReportEntryVisibilityNever— never on console, but still in the JSON report.
For failure-only diagnostics, call AddReportEntry from a DeferOnFailure callback (→ ginkgo:writing-specs).
value is JSON-round-tripped into the report (retrieve via entry.GetRawValue() / json.Unmarshal(entry.Value.AsJSON, ...)). A fmt.Stringer/types.ColorableStringer controls console rendering; pass a pointer to capture later mutations. AddReportEntry decorators (Offset, CodeLocation, ReportEntryVisibility) → ginkgo:decorators.
Recap (owned by ginkgo:writing-specs): GinkgoWriter buffers log output a
자주 묻는 질문
JUnit 보고서란 무엇인가요?
많은 빌드 및 테스트 시스템이 테스트 결과를 보여 주기 위해 읽을 수 있는 표준 파일 형식입니다.
실행되는 각 테스트를 볼 수 있나요?
네. 자세한 옵션은 테스트마다 타임라인을 보여 주며, 병렬 실행에서는 각 테스트가 끝난 뒤 타임라인이 나옵니다.
이 스킬이 테스트를 바꾸나요?
주로 명령 옵션과 보고 코드를 다루므로, 보고 단계를 추가하지 않는 한 테스트는 그대로입니다.
상세 정보
작성자의 원본 설명
Generate, consume, and enrich Ginkgo reports — console verbosity (-v/-vv/--trace/--no-color/--succinct), machine-readable reports (--json-report/--junit-report with --output-dir/--keep-separate-reports), programmatic reporting nodes (ReportAfterEach, ReportAfterSuite, CurrentSpecReport), AddReportEntry with ReportEntryVisibility, and profiling (--cover/--race/--cpuprofile/--memprofile). Use when you need a report file, custom suite-level reporting, attaching data to a spec, controlling console output, or profiling a suite.
repo: onsi/ginkgo
인기도
- GitHub 스타
- 9.1k
- 순위
- #12305
- 라이선스
- MIT
- 업데이트
- 2026. 10. 9.
댓글
- …
이 저장소의 다른 스킬
ci
9.1k에이전트가 지속적 통합에서 Ginkgo 테스트를 설정하도록 돕습니다. 남은 focus나 pending 표시와 불안정한 테스트를 잡아내는 권장 플래그를 씁니다.
debugging-failures
9.1k에이전트가 요약 줄을 읽고 JSON 보고서에서 실패한 정확한 테스트와 메시지를 꺼내서, Ginkgo 테스트가 왜 실패했는지 알아내도록 돕습니다.
decorators
9.1k에이전트가 Serial, Ordered, Label, Focus, 제한 시간 같은 Ginkgo 테스트 데코레이터를 바르게 쓰도록 각각의 역할을 설명해 돕습니다.
filtering
9.1k에이전트가 pending, skip, focus, 라벨, 버전 조건, 파일 필터를 올바른 우선순위에 따라 써서 Ginkgo 테스트의 일부만 실행하도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.