decorators
하는 일
이 스킬은 Ginkgo가 테스트를 실행하거나 고르는 방식을 바꾸는 데코레이터를 설명하는 참고 자료입니다. 올바른 옵션이 필요한 Ginkgo 테스트 작성자를 위한 것입니다.
사용하는 경우
- ✓특정 Ginkgo 테스트를 한 번에 하나씩 또는 정해진 순서로 실행하고 싶을 때.
- ✓라벨로 테스트에 태그를 붙여서 일부만 실행하고 싶을 때.
- ✓느린 테스트에 제한 시간이나 재시도 설정이 필요할 때.
스킬 링크
https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/decorators/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 Ginkgo 테스트를 병렬이 아니라 단독으로 실행하고, 제한 시간은 30초로 설정해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 각 노드에 맞는 데코레이터를 고릅니다. 예를 들어 병렬 실행을 막는 Serial이나 시간 제한을 두는 NodeTimeout을 씁니다. 그리고 각 데코레이터를 어떤 종류의 블록에 붙일 수 있는지 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Ginkgo decorator reference
Terse lookup. Decorators are passed alongside a node's text/closure: It("...", Serial, Label("slow"), func(){...}). Most attach to containers and/or subjects; some are setup-only or interruptible-only. Decorators on a container apply to all nodes within it; the innermost/most-specific wins when they conflict. Full docs: https://onsi.github.io/ginkgo/#decorator-reference.
Execution / ordering
Serial(container, subject) — never runs in parallel; Ginkgo runs serial specs last, on process #1. →ginkgo:parallelism.Ordered(container only) — child specs run in definition order, never reordered; enablesBeforeAll/AfterAll. →ginkgo:ordering-and-flakes.ContinueOnFailure(outermostOrderedcontainer only) — a failing spec doesn't skip the rest of the ordered group.OncePerOrdered(setup nodes) — makes aBeforeEach/AfterEachrun once around anOrderedcontainer (like aBeforeAll) instead of per-spec.SpecPriority(int)(container, subject) — hint to run higher-priority specs earlier; use sparingly, not to impose a total order.
Selection / filtering (→ ginkgo:filtering)
Label("a", "b")(container, subject) — tag specs for--label-filter; labels union down the hierarchy. No&|!,()/"chars.Focus(container, subject) — run only focused specs; don't commit it (CI exits non-zero). Constructors:FDescribe,FContext,FIt,FEntry.Pending(container, subject) — never run (and never compiled into the run set); no closure needed. Constructors:PDescribe,XDescribe,PIt,XIt,PEntry.SemVerConstraint(">= 2.0.0", ...)/ComponentSemVerConstraint("redis", ">= 8.0.0")(container, subject) — run only when--sem-ver-filtersatisfies the constraint; children may narrow, not widen.
Flakiness / repetition (→ ginkgo:ordering-and-flakes)
FlakeAttempts(n)(container, subject) — retry a failing spec up tontimes; a later pass marks it flaky, not failed. CLI--flake-attempts=noverrides.MustPassRepeatedly(n)(container, subject) — the spec must passntimes in a row to count as passed.
Timeouts / interruption (interruptible nodes — those taking ctx SpecContext; → ginkgo:timeouts-and-async)
NodeTimeout(d)(subject, setup,DeferCleanup/DeferOnFailure) — deadline for a single interruptible node.SpecTimeout(d)(Itonly) — deadline for the whole spec (all its nodes combined).GracePeriod(d)(subject, setup,DeferCleanup/DeferOnFailure) — how long Ginkgo waits for an interrupted node to return before leaking it; overrides--grace-period.
Progress reporting (→ ginkgo:debugging-failures)
PollProgressAfter(d)(subject, setup) — emit a progress report if the node runs longer thand;0disables.PollProgressInterval(d)(subject, setup) — interval between progress reports once they start.SuppressProgressReporting(subject, setup) — silence progress reports for this node.
Wrapping / advanced
AroundNode(fn)(any node, incl.RunSpecs) — wrap a node's execution; forms a stack on a container applied to every descendant node (unlikeBeforeEach, which runs once per spec). Forms: a barefunc(), a context transformerfunc(context.Context) context.Context, or a full wrapperfunc(ctx, func(context.Context)).
Location / identity (rarely needed by hand)
Offset(n)(any node) — skipnstack frames when computing the reported code location. PreferGinkgoHelper()inside helper funcs instead.CodeLocation(loc)(any node) — supply atypes.CodeLocationexplicitly.
Tables
EntryDescription("format %d")— auto-formatEntrydescriptions from their parameters; usable table-wide or per-entry. →ginkgo:tables-and-dynamic-specs.Entry/Italso acceptLabel,Focus,Pending,FlakeAttempts, etc. — every decorator above works on table entries.
Reporting
ReportEntryVisibility{Always,FailureOrVerbose,Never}— passed toAddReportEntryto control console emission. →ginkgo:reporting.
자주 묻는 질문
데코레이터를 테스트 그룹 전체에 적용할 수 있나요?
일부는 가능합니다. 이 스킬은 그룹에 적용되는 데코레이터와 단일 테스트에만 적용되는 데코레이터를 구분해 알려 줍니다.
두 데코레이터가 충돌하면 어떻게 되나요?
테스트에 가장 가까운, 가장 구체적인 것이 우선합니다.
Focus를 커밋해도 되나요?
아니요. 이 스킬은 Focus를 커밋하지 말라고 안내합니다. 남아 있으면 CI가 실패하기 때문입니다.
상세 정보
작성자의 원본 설명
One-line reference for every Ginkgo decorator, grouped by what it does, with the node types each can decorate — Serial, Ordered, ContinueOnFailure, OncePerOrdered, Label, Focus, Pending, FlakeAttempts, MustPassRepeatedly, NodeTimeout, SpecTimeout, GracePeriod, PollProgressAfter/Interval, SuppressProgressReporting, SpecPriority, SemVerConstraint, AroundNode, Offset/CodeLocation, EntryDescription. Use to look up a decorator's exact name, semantics, and where it's legal.
repo: onsi/ginkgo
인기도
- GitHub 스타
- 9.1k
- 순위
- #12300
- 라이선스
- MIT
- 업데이트
- 2026. 10. 9.
댓글
- …
이 저장소의 다른 스킬
ci
9.1k에이전트가 지속적 통합에서 Ginkgo 테스트를 설정하도록 돕습니다. 남은 focus나 pending 표시와 불안정한 테스트를 잡아내는 권장 플래그를 씁니다.
debugging-failures
9.1k에이전트가 요약 줄을 읽고 JSON 보고서에서 실패한 정확한 테스트와 메시지를 꺼내서, Ginkgo 테스트가 왜 실패했는지 알아내도록 돕습니다.
filtering
9.1k에이전트가 pending, skip, focus, 라벨, 버전 조건, 파일 필터를 올바른 우선순위에 따라 써서 Ginkgo 테스트의 일부만 실행하도록 돕습니다.
ordering-and-flakes
9.1k에이전트가 Ginkgo의 Serial 및 Ordered 설정과 재시도 옵션으로 Go 테스트의 순서를 관리하고 불안정한 테스트를 다루도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.