ci
Что он делает
Этот скилл настраивает тесты на Go, написанные с Ginkgo, чтобы они надёжно работали в автоматических сборках. Он нужен разработчикам, которые хотят, чтобы запуски в CI ловили ошибки и понятно показывали результаты.
Когда использовать
- ✓Когда вы настраиваете тесты Ginkgo в конвейере CI.
- ✓Когда тесты Ginkgo проходят на вашем компьютере, но ведут себя иначе в CI.
- ✓Когда вам нужны машиночитаемые отчёты о тестах из автоматических запусков.
Ссылка на скилл
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/ci/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Настрой мои тесты 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 committedPending/PIt/XItbecomes 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/Focusexits non-zero — Ginkgo's built-in guard against shipping focus. Don't suppress it; fix it withginkgo unfocus(→ginkgo:filtering).
Collecting artifacts
Point reports and profiles at one directory and upload it as a build artifact:
--output-dir=.ginkgo-reportcollects the JSON report (and, under-r, merges all suites into onereport.json) plus coverage/profiles into one place. →ginkgo:reportingfor--keep-separate-reportsand the other formats.--junit-report=junit.xmladditionally if your CI system renders JUnit — but keep--json-reportas the source of truth; JUnit loses Ginkgo metadata.- An agent or human then diagnoses failures straight from
report.jsonwithjq→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(orGINKGO_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 и фильтры, которые не совпадают ни с одним тестом и могут скрывать ошибки.
Зачем перемешивать порядок тестов?
Случайный порядок помогает выявить тесты, которые случайно зависят друг от друга.
Подробности
Оригинальное описание автора
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
- Обновлён
- 09.10.2026
Комментарии
- …
Другие скиллы из этого репозитория
debugging-failures
9.1kПомогает агенту понять, почему тесты Ginkgo упали: он читает строку с итогом и достаёт точные падающие тесты и сообщения из JSON-отчёта.
decorators
9.1kПомогает агенту правильно использовать декораторы тестов Ginkgo, например Serial, Ordered, Label, Focus и таймауты, объясняя, что делает каждый из них.
filtering
9.1kПомогает агенту запускать только часть тестов Ginkgo, используя pending, skip, focus, метки, ограничения версий и фильтры по файлам в правильном порядке приоритетов.
ordering-and-flakes
9.1kПомогает агенту управлять порядком тестов Go и обрабатывать нестабильные тесты с помощью настроек Serial и Ordered в Ginkgo и опций повтора.
Похожие скиллы
test-driven-development
311kУчит агента сначала писать падающий тест, увидеть, что он падает, и только затем писать минимальный код, который его проходит, прежде чем создавать любую функцию или исправление.
verification-before-completion
311kУчит агента запускать настоящие проверки и читать их вывод, прежде чем утверждать, что задача, исправление или сборка готовы или проходят.
migrate-to-shoehorn
310kЗаменяет рискованные приведения типов в тестовых файлах на библиотеку shoehorn, чтобы тесты могли использовать неполные данные и проходить проверку типов.