본문으로 건너뛰기
Skillpedia
테스트9.1k · #12300

decorators

하는 일

이 스킬은 Ginkgo가 테스트를 실행하거나 고르는 방식을 바꾸는 데코레이터를 설명하는 참고 자료입니다. 올바른 옵션이 필요한 Ginkgo 테스트 작성자를 위한 것입니다.

사용하는 경우

  • ✓특정 Ginkgo 테스트를 한 번에 하나씩 또는 정해진 순서로 실행하고 싶을 때.
  • ✓라벨로 테스트에 태그를 붙여서 일부만 실행하고 싶을 때.
  • ✓느린 테스트에 제한 시간이나 재시도 설정이 필요할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/skills/decorators/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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; enables BeforeAll/AfterAll. → ginkgo:ordering-and-flakes.
  • ContinueOnFailure (outermost Ordered container only) — a failing spec doesn't skip the rest of the ordered group.
  • OncePerOrdered (setup nodes) — makes a BeforeEach/AfterEach run once around an Ordered container (like a BeforeAll) 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-filter satisfies the constraint; children may narrow, not widen.

Flakiness / repetition (→ ginkgo:ordering-and-flakes)

  • FlakeAttempts(n) (container, subject) — retry a failing spec up to n times; a later pass marks it flaky, not failed. CLI --flake-attempts=n overrides.
  • MustPassRepeatedly(n) (container, subject) — the spec must pass n times 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) (It only) — 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 than d; 0 disables.
  • 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 (unlike BeforeEach, which runs once per spec). Forms: a bare func(), a context transformer func(context.Context) context.Context, or a full wrapper func(ctx, func(context.Context)).

Location / identity (rarely needed by hand)

  • Offset(n) (any node) — skip n stack frames when computing the reported code location. Prefer GinkgoHelper() inside helper funcs instead.
  • CodeLocation(loc) (any node) — supply a types.CodeLocation explicitly.

Tables

  • EntryDescription("format %d") — auto-format Entry descriptions from their parameters; usable table-wide or per-entry. → ginkgo:tables-and-dynamic-specs.
  • Entry/It also accept Label, Focus, Pending, FlakeAttempts, etc. — every decorator above works on table entries.

Reporting

  • ReportEntryVisibility{Always,FailureOrVerbose,Never} — passed to AddReportEntry to 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬