1 package ginkgo 2 3 import ( 4 "github.com/onsi/ginkgo/v2/internal" 5 ) 6 7 /* 8 Offset(uint) is a decorator that allows you to change the stack-frame offset used when computing the line number of the node in question. 9 10 You can learn more here: https://onsi.github.io/ginkgo/#the-offset-decorator 11 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 12 */ 13 type Offset = internal.Offset 14 15 /* 16 FlakeAttempts(uint N) is a decorator that allows you to mark individual specs or spec containers as flaky. Ginkgo will run them up to `N` times until they pass. 17 18 You can learn more here: https://onsi.github.io/ginkgo/#the-flakeattempts-decorator 19 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 20 */ 21 type FlakeAttempts = internal.FlakeAttempts 22 23 /* 24 MustPassRepeatedly(uint N) is a decorator that allows you to repeat the execution of individual specs or spec containers. Ginkgo will run them up to `N` times until they fail. 25 26 You can learn more here: https://onsi.github.io/ginkgo/#the-mustpassrepeatedly-decorator 27 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 28 */ 29 type MustPassRepeatedly = internal.MustPassRepeatedly 30 31 /* 32 Focus is a decorator that allows you to mark a spec or container as focused. Identical to FIt and FDescribe. 33 34 You can learn more here: https://onsi.github.io/ginkgo/#filtering-specs 35 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 36 */ 37 const Focus = internal.Focus 38 39 /* 40 Pending is a decorator that allows you to mark a spec or container as pending. Identical to PIt and PDescribe. 41 42 You can learn more here: https://onsi.github.io/ginkgo/#filtering-specs 43 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 44 */ 45 const Pending = internal.Pending 46 47 /* 48 Serial is a decorator that allows you to mark a spec or container as serial. These specs will never run in parallel with other specs. 49 Specs in ordered containers cannot be marked as serial - mark the ordered container instead. 50 51 You can learn more here: https://onsi.github.io/ginkgo/#serial-specs 52 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 53 */ 54 const Serial = internal.Serial 55 56 /* 57 Ordered is a decorator that allows you to mark a container as ordered. Specs in the container will always run in the order they appear. 58 They will never be randomized and they will never run in parallel with one another, though they may run in parallel with other specs. 59 60 You can learn more here: https://onsi.github.io/ginkgo/#ordered-containers 61 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 62 */ 63 const Ordered = internal.Ordered 64 65 /* 66 ContinueOnFailure is a decorator that allows you to mark an Ordered container to continue running specs even if failures occur. Ordinarily an ordered container will stop running specs after the first failure occurs. Note that if a BeforeAll or a BeforeEach/JustBeforeEach annotated with OncePerOrdered fails then no specs will run as the precondition for the Ordered container will consider to be failed. 67 68 ContinueOnFailure only applies to the outermost Ordered container. Attempting to place ContinueOnFailure in a nested container will result in an error. 69 70 You can learn more here: https://onsi.github.io/ginkgo/#ordered-containers 71 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 72 */ 73 const ContinueOnFailure = internal.ContinueOnFailure 74 75 /* 76 OncePerOrdered is a decorator that allows you to mark outer BeforeEach, AfterEach, JustBeforeEach, and JustAfterEach setup nodes to run once 77 per ordered context. Normally these setup nodes run around each individual spec, with OncePerOrdered they will run once around the set of specs in an ordered container. 78 The behavior for non-Ordered containers/specs is unchanged. 79 80 You can learn more here: https://onsi.github.io/ginkgo/#setup-around-ordered-containers-the-onceperordered-decorator 81 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 82 */ 83 const OncePerOrdered = internal.OncePerOrdered 84 85 /* 86 Label decorates specs with Labels. Multiple labels can be passed to Label and these can be arbitrary strings but must not include the following characters: "&|!,()/". 87 Labels can be applied to container and subject nodes, but not setup nodes. You can provide multiple Labels to a given node and a spec's labels is the union of all labels in its node hierarchy. 88 89 You can learn more here: https://onsi.github.io/ginkgo/#spec-labels 90 You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference 91 */ 92 func Label(labels ...string) Labels { 93 return Labels(labels) 94 } 95 96 /* 97 Labels are the type for spec Label decorators. Use Label(...) to construct Labels. 98 You can learn more here: https://onsi.github.io/ginkgo/#spec-labels 99 */ 100 type Labels = internal.Labels 101 102 /* 103 PollProgressAfter allows you to override the configured value for --poll-progress-after for a particular node. 104 105 Ginkgo will start emitting node progress if the node is still running after a duration of PollProgressAfter. This allows you to get quicker feedback about the state of a long-running spec. 106 */ 107 type PollProgressAfter = internal.PollProgressAfter 108 109 /* 110 PollProgressInterval allows you to override the configured value for --poll-progress-interval for a particular node. 111 112 Once a node has been running for longer than PollProgressAfter Ginkgo will emit node progress periodically at an interval of PollProgresInterval. 113 */ 114 type PollProgressInterval = internal.PollProgressInterval 115 116 /* 117 NodeTimeout allows you to specify a timeout for an indivdiual node. The node cannot be a container and must be interruptible (i.e. it must be passed a function that accepts a SpecContext or context.Context). 118 119 If the node does not exit within the specified NodeTimeout its context will be cancelled. The node wil then have a period of time controlled by the GracePeriod decorator (or global --grace-period command-line argument) to exit. If the node does not exit within GracePeriod Ginkgo will leak the node and proceed to any clean-up nodes associated with the current spec. 120 */ 121 type NodeTimeout = internal.NodeTimeout 122 123 /* 124 SpecTimeout allows you to specify a timeout for an indivdiual spec. SpecTimeout can only decorate interruptible It nodes. 125 126 All nodes associated with the It node will need to complete before the SpecTimeout has elapsed. Individual nodes (e.g. BeforeEach) may be decorated with different NodeTimeouts - but these can only serve to provide a more stringent deadline for the node in question; they cannot extend the deadline past the SpecTimeout. 127 128 If the spec does not complete within the specified SpecTimeout the currently running node will have its context cancelled. The node wil then have a period of time controlled by that node's GracePeriod decorator (or global --grace-period command-line argument) to exit. If the node does not exit within GracePeriod Ginkgo will leak the node and proceed to any clean-up nodes associated with the current spec. 129 */ 130 type SpecTimeout = internal.SpecTimeout 131 132 /* 133 GracePeriod denotes the period of time Ginkgo will wait for an interruptible node to exit once an interruption (whether due to a timeout or a user-invoked signal) has occurred. If both the global --grace-period cli flag and a GracePeriod decorator are specified the value in the decorator will take precedence. 134 135 Nodes that do not finish within a GracePeriod will be leaked and Ginkgo will proceed to run subsequent nodes. In the event of a timeout, such leaks will be reported to the user. 136 */ 137 type GracePeriod = internal.GracePeriod 138 139 /* 140 SuppressProgressReporting is a decorator that allows you to disable progress reporting of a particular node. This is useful if `ginkgo -v -progress` is generating too much noise; particularly 141 if you have a `ReportAfterEach` node that is running for every skipped spec and is generating lots of progress reports. 142 */ 143 const SuppressProgressReporting = internal.SuppressProgressReporting 144