Published by onsi about 2 years ago
Several users were invoking ginkgo
by installing the latest version of the cli via go install github.com/onsi/ginkgo/v2/ginkgo@latest
. When 2.3.0 was released this resulted in an influx of issues as CI systems failed due to a change in the internal contract between the Ginkgo CLI and the Ginkgo library. Ginkgo only supports running the same version of the library as the cli (which is why both are packaged in the same repository).
With this patch release, the ginkgo CLI can now identify a version mismatch and emit a helpful error message.
Published by onsi about 2 years ago
Ginkgo now supports per-node and per-spec timeouts on interruptible nodes. Check out the documentation for all the details but the gist is you can now write specs like this:
It("is interruptible", func(ctx SpecContext) { // or context.Context instead of SpecContext, both are valid.
// do things until `ctx.Done()` is closed, for example:
req, err := http.NewRequestWithContext(ctx, "POST", "/build-widgets", nil)
Expect(err).NotTo(HaveOccured())
_, err := http.DefaultClient.Do(req)
Expect(err).NotTo(HaveOccured())
Eventually(client.WidgetCount).WithContext(ctx).Should(Equal(17))
}, NodeTimeout(time.Second*20), GracePeriod(5*time.Second))
and have Ginkgo ensure that the node completes before the timeout elapses. If it does elapse, or if an external interrupt is received (e.g. ^C
) then Ginkgo will cancel the context and wait for the Grace Period for the node to exit before proceeding with any cleanup nodes associated with the spec. The ctx
provided by Ginkgo can also be passed down to Gomega's Eventually
to have all assertions within the node governed by a single deadline.
SpecContext
also provides a mechanism for third-party libraries to provide additional information when a Progress Report is generated. Gomega uses this to provide the current state of an Eventually().WithContext()
assertion when a Progress Report is requested.Published by onsi about 2 years ago
Ginkgo can now generate Progress Reports to point users at the current running line of code (including a preview of the actual source code) and a best guess at the most relevant subroutines.
These Progress Reports allow users to debug stuck or slow tests without exiting the Ginkgo process. A Progress Report can be generated at any time by sending Ginkgo a SIGINFO
(^T
on MacOS/BSD) or SIGUSR1
.
In addition, the user can specify --poll-progress-after
and --poll-progress-interval
to have Ginkgo start periodically emitting progress reports if a given node takes too long. These can be overriden/set on a per-node basis with the PollProgressAfter
and PollProgressInterval
decorators.
Progress Reports are emitted to stdout, and also stored in the machine-redable report formats that Ginkgo supports.
Ginkgo also uses this progress reporting infrastructure under the hood when handling timeouts and interrupts. This yields much more focused, useful, and informative stack traces than previously.
BeforeSuite
, AfterSuite
, SynchronizedBeforeSuite
, SynchronizedAfterSuite
, and ReportAfterSuite
now support (the relevant subset of) decorators. These can be passed in after the callback functions that are usually passed into these nodes.
As a result the signature of these methods has changed and now includes a trailing args ...interface{}
. For most users simply using the DSL, this change is transparent. However if you were assigning one of these functions to a custom variable (or passing it around) then your code may need to change to reflect the new signature.
Published by onsi about 2 years ago
SuppressProgressReporting
decorator to turn off --progress announcements for a given node [dfef62a]Published by onsi about 2 years ago
CurrentSpecReport
and AddReportEntry
are thread-safe [817c09b]Published by onsi over 2 years ago
when
when using When
(this behavior was in 1.x but unintentionally lost during the 2.0 rewrite) [efce903]Published by onsi over 2 years ago
See https://onsi.github.io/ginkgo/MIGRATING_TO_V2 for details on V2.
Published by onsi over 2 years ago
ginkgo unfocus
[a612ff1]Published by onsi over 2 years ago
See https://onsi.github.io/ginkgo/MIGRATING_TO_V2 for details on V2.
Published by onsi almost 3 years ago
See https://onsi.github.io/ginkgo/MIGRATING_TO_V2 for details on V2.
2.1.0 is a minor release with a few tweaks:
Published by onsi almost 3 years ago
Ginkgo v2.0.0 is a major new release of Ginkgo.
The changes to Ginkgo are substantial and wide-ranging, however care has been given to ensure that most users will experience a smooth migration from V1 to V2 with relatively little work. A combined changelog and migration guides is available here and the Ginkgo docs have been updated to capture the new functionality in V2.
Published by onsi about 3 years ago
Ginkgo 2.0 now has a Release Candidate. 1.16.5 advertises the existence of the RC.
1.16.5 deprecates GinkgoParallelNode in favor of GinkgoParallelProcess
You can silence the RC advertisement by setting an ACK_GINKG_RC=true
environment variable or creating a file in your home directory called .ack-ginkgo-rc
Published by onsi over 3 years ago
1.16.4 retracts 1.16.3. There are no code changes. The 1.16.3 tag was associated with the wrong commit and an attempt to change it after-the-fact has proven problematic. 1.16.4 retracts 1.16.3 in Ginkgo's go.mod and creates a new, correctly tagged, release.
Published by onsi over 3 years ago
Published by onsi over 3 years ago
ACK_GINKGO_DEPRECATIONS=<semver>
environment variable.Published by onsi over 3 years ago
Published by onsi over 3 years ago
Advertise Ginkgo 2.0. Introduce deprecations. [9ef1913]
Add slim-sprig template functions to bootstrap/generate (#775) [9162b86]
Published by onsi over 3 years ago
-focus
and -skip
flags (#780) [e90a4a0]Published by blgm over 3 years ago
system-out
element instead of passed
(#769) [9eda305]Published by blgm over 3 years ago