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

ci

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

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

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

  • ✓जब आप CI pipeline में Ginkgo टेस्ट सेट कर रहे हों।
  • ✓जब Ginkgo टेस्ट आपके कंप्यूटर पर पास होते हैं, पर CI में अलग व्यवहार करते हैं।
  • ✓जब आपको स्वचालित रन से मशीन-पढ़ने योग्य टेस्ट रिपोर्ट चाहिए।

Skill का लिंक

https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/ci/SKILL.md

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

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

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

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

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

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

“मेरे Go Ginkgo टेस्ट को सुझाए गए flags और JSON रिपोर्ट के साथ CI में चलने के लिए सेट कीजिए।”

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

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

एजेंट Ginkgo टूल को go run से चलाता है ताकि उसका वर्शन आपके प्रोजेक्ट से मेल खाए, और random क्रम, parallel रन, बचे pending या focus निशानों पर fail होने और JSON रिपोर्ट के लिए flags जोड़ता है।

तकनीकी सामग्री (मूल 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 से क्यों चलाएं?

इससे Ginkgo टूल का वर्शन आपकी go.mod फ़ाइल के वर्शन के साथ मेल में रहता है, और अलग इंस्टॉल की वजह से गड़बड़ नहीं होती।

सुरक्षा जांच क्या पकड़ती है?

कमिट किए गए focus या pending निशान और ऐसे filters जो कोई टेस्ट न पकड़ें, क्योंकि वे फ़ेल होने वाले टेस्ट छिपा सकते हैं।

टेस्ट का क्रम random क्यों करें?

Random क्रम उन टेस्ट को सामने लाने में मदद करता है जो अनजाने में एक-दूसरे पर निर्भर होते हैं।

जानकारी

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

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
अपडेट की गई
9/10/2026

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

0

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

कमेंट

  • …

इस repository की और skills

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