reporting
यह क्या करती है
यह स्किल बताती है कि Ginkgo टेस्ट के नतीजे कैसे दिखें और उन्हें मशीन-पढ़ने योग्य रिपोर्ट के रूप में कैसे सेव करें। यह उन डेवलपर्स के लिए है जिन्हें साफ़ टेस्ट आउटपुट या दूसरे टूल्स के लिए रिपोर्ट चाहिए।
कब इस्तेमाल करें
- ✓जब आप स्क्रीन पर दिखने वाले टेस्ट नतीजों में कम या ज़्यादा विवरण चाहते हों।
- ✓जब आपको Ginkgo टेस्ट से JSON या JUnit रिपोर्ट फ़ाइल चाहिए।
- ✓जब आप Go टेस्ट का code coverage या performance जांचना चाहते हों।
Skill का लिंक
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/reporting/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप मेरे Go टेस्ट को JUnit रिपोर्ट सेव करने वाला बना सकते हैं, ताकि हमारा CI सिस्टम उसे पढ़ सके?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह उन command विकल्पों को दिखाती है जो विस्तृत आउटपुट छापते हैं, रिपोर्ट फ़ाइलें लिखते हैं, और coverage या गति मापते हैं।
तकनीकी सामग्री (मूल 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 रिपोर्ट क्या है?
यह एक मानक फ़ाइल फ़ॉर्मेट है, जिसे कई build और test सिस्टम टेस्ट नतीजे दिखाने के लिए पढ़ सकते हैं।
क्या मैं चलते हुए हर टेस्ट को देख सकता हूं?
हाँ, verbose विकल्प हर टेस्ट की टाइमलाइन दिखाते हैं, हालांकि parallel रन में हर टाइमलाइन उस टेस्ट के खत्म होने के बाद दिखती है।
क्या यह स्किल मेरे टेस्ट बदलती है?
यह मुख्य रूप से command विकल्प और रिपोर्टिंग कोड कवर करती है, इसलिए जब तक आप रिपोर्टिंग के चरण न जोड़ें, आपके टेस्ट वैसे ही रहते हैं।
जानकारी
लेखक का मूल विवरण
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
- अपडेट की गई
- 9/10/2026
कमेंट
- …
इस repository की और skills
ci
9.1kयह आपके एजेंट को Ginkgo टेस्ट CI के लिए सेट करने में मदद करती है, ताकि बचे हुए focus या pending निशान और flaky टेस्ट पकड़े जा सकें।
debugging-failures
9.1kयह आपके एजेंट को summary लाइन पढ़कर और JSON रिपोर्ट से ठीक फ़ेल होने वाले टेस्ट और संदेश निकालकर Ginkgo टेस्ट फ़ेल होने का कारण ढूंढने में मदद करती है।
decorators
9.1kयह आपके एजेंट को Ginkgo टेस्ट decorators सही ढंग से इस्तेमाल करने में मदद करती है, जैसे Serial, Ordered, Label, Focus और timeouts, हर एक का काम समझाकर।
filtering
9.1kयह आपके एजेंट को Ginkgo के कुछ ही टेस्ट चलाने में मदद करती है, pending, skip, focus, labels और file filters को सही क्रम में लगाकर।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।