मुख्य सामग्री पर जाएँ
Skillpedia
टेस्टिंग9.1k · #12299

debugging-failures

यह क्या करती है

यह स्किल दिखाती है कि लंबे लॉग पढ़े बिना Go Ginkgo टेस्ट क्यों फ़ेल हुए, यह कैसे पता करें। यह उन डेवलपर्स और एजेंट्स के लिए है जिन्हें जल्दी साफ़ कारण चाहिए।

कब इस्तेमाल करें

  • ✓जब Ginkgo टेस्ट सूट फ़ेल हो और आपको पता करना हो कि कौन सा टेस्ट और क्यों फ़ेल हुआ।
  • ✓जब टेस्ट parallel चलने से आउटपुट आपस में मिल गया हो।
  • ✓जब आप फ़ेल होने वाले टेस्ट को उसी random क्रम के साथ दोबारा चलाना चाहते हों।

Skill का लिंक

https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/debugging-failures/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/debugging-failures/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे Ginkgo टेस्ट फ़ेल हो गए हैं। पता कीजिए कि ठीक कौन से टेस्ट फ़ेल हुए और क्यों।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट सूट को JSON रिपोर्ट के साथ एक बार चलाता है, एक लाइन का नतीजा पढ़ता है, और filter से केवल फ़ेल होने वाले टेस्ट, उनके संदेश, फ़ाइल की जगह और रिकॉर्ड किए गए logs निकालता है। वह उसी seed से दोबारा चलाकर फ़ेल होना दोहरा सकता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Debugging Ginkgo failures (especially as an agent)

Ginkgo's terminal output is good for a human; for programmatic diagnosis, prefer a hybrid: terminal for the verdict, JSON + jq for the details. This is empirically the most reliable, lowest-token workflow. Docs: https://onsi.github.io/ginkgo/#reporting-and-profiling-suites.

The workflow: one run, JSON-first diagnosis

# One invocation gives you BOTH the human verdict on the terminal AND a structured report.
# --json-report does NOT suppress console output, so you don't pay for two runs.
ginkgo -r -p --no-color --json-report=report.json --output-dir=.ginkgo-report
  1. Read the terminal tail for the one-line verdict: FAIL! -- 5 Passed | 6 Failed | 1 Pending | 1 Skipped. Cheap, immediate.
  2. If there are failures, query the JSON with jq (filters below) to get exactly the failing specs — stable, addressable, order-independent.
  3. Clean up the report dir when done.

Why hybrid and not one or the other:

  • Terminal-only is brittle to parse (free-form text) and, under -p, interleaves failures in nondeterministic order.
  • JSON-only is wasteful if you dump it: the full report.json is ~9× the tokens of the terminal output. A jq failures-only extraction is a fraction of either. The discipline is filter, don't dump.

Where the JSON lands (use --output-dir deliberately)

  • --json-report=report.json alone writes report.json to the current directory — which scatters into package dirs under -r and risks getting committed.
  • Prefer --output-dir=DIR to collect everything in one known place (auto-created). With -r, all suites merge into one DIR/report.json — ideal: one file, one set of jq filters.
  • Use a gitignored or temp location: a repo-local .ginkgo-report/ (add it to .gitignore) or an absolute temp path (--output-dir=/tmp/ginkgo-report). Don't leave report.json in the working tree.
  • --keep-separate-reports (with -r) writes one PACKAGE_report.json per package instead of merging — only reach for it when you must attribute failures per package.

The jq filters (tested against the real schema)

The report is an array of suite reports, each with a .SpecReports[] array.

Verdict / counts per suite:

jq -r '.[] | "\(.SuiteDescription): \([.SpecReports[].State]|group_by(.)|map("\(length) \(.[0])")|join(", "))"' .ginkgo-report/report.json

All failures — name, location, message (the workhorse). Select failed and panicked and timedout — see the trap below:

jq -r '.[].SpecReports[]
  | select(.State=="failed" or .State=="panicked" or .State=="timedout")
  | "[\(.State|ascii_upcase)] \((.ContainerHierarchyTexts+[.LeafNodeText])|join(" > "))\n  \(.Failure.Location.FileName):\(.Failure.Location.LineNumber)\n  \(.Failure.Message)"' .ginkgo-report/report.json

Panics — the real user-code line (the headline location lies; see below):

jq -r '.[].SpecReports[] | select(.State=="panicked")
  | "PANIC: \(.Failure.ForwardedPanic)\n\(.Failure.Location.FullStackTrace)"' .ginkgo-report/report.json

Drill into one spec by name, with its captured logs:

jq -r '.[].SpecReports[] | select(.LeafNodeText|test("SUBSTRING"))
  | "STATE: \(.State)\n\(.Failure.Message)\n--- GinkgoWriter ---\n\(.CapturedGinkgoWriterOutput // "(none)")"' .ginkgo-report/report.json

Slowest specs:

jq '.[0].SpecReports | map([(.ContainerHierarchyTexts+[.LeafNodeText])|join(" "), .RunTime/1e9]) | sort_by(.[1]) | reverse | .[0:10]' .ginkgo-report/report.json

Schema facts you need

  • State: passed | failed | panicked | pending | skipped | timedout | interrupted | aborted.
  • Spec name = ContainerHierarchyTexts (array) + LeafNodeText.
  • Failure.Message — the failure text (Gomega's full expected/got block for assertions).
  • Failure.Location.{FileName,LineNumber,FullStackTrace}.
  • Failure.ForwardedPanic — the panic value (only meaningful for panicked).
  • Failure.FailureNodeType — e.g. BeforeEach vs It, so you know a setup node failed.
  • CapturedGinkgoWriterOutput — GinkgoWriter logs (omitted if empty).
  • SpecEvents[] — By(...) steps and node enter/exit (does not include raw GinkgoWriter text).
  • ParallelProcess — which worker ran the spec (-p).
  • AdditionalFailures[] — failures beyond the primary Failure (e.g. a failing AfterEach or DeferOnFailure callback). Usually the primary is
अक्सर पूछे जाने वाले सवाल

पूरा लॉग क्यों न पढ़ें?

parallel रन में फ़ेल संदेश आपस में मिल सकते हैं, और पूरी रिपोर्ट बहुत बड़ी होती है, इसलिए स्किल विवरण छानती है।

seed क्या है?

यह वह संख्या है जो टेस्ट का random क्रम तय करती है, और उसी को दोबारा इस्तेमाल करने से वही रन दोहराया जाता है।

क्या यह रिपोर्ट फ़ाइलें साफ़ करती है?

हाँ। निदान पूरा होने पर स्किल रिपोर्ट फ़ोल्डर हटाकर खत्म होती है।

जानकारी

लेखक का मूल विवरण

Diagnose a failing Ginkgo suite as an agent — always run with --json-report into a predictable temp/gitignored location, read the terminal verdict line, then use jq to extract structured failure details (name, message, file:line, panic value, captured logs). Covers the panicked-vs-failed trap, panic locations pointing into the Go runtime, parallel output interleaving, reproducing with --seed, and progress reports for hangs. Use when a suite failed and you need to know why. Also invokable as /ginkgo:debugging-failures.

repo: onsi/ginkgo

लोकप्रियता

GitHub स्टार
9.1k
रैंकिंग में स्थान
#12299
लाइसेंस
MIT
अपडेट की गई
9/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills