Releases: onsi/ginkgo
v2.3.1
2.3.1
Fixes
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.
- Ginkgo cli can identify version mismatches and emit a helpful error message [bc4ae2f]
- further emphasize that a version match is required when running Ginkgo on CI and/or locally [2691dd8]
Maintenance
- bump gomega to v1.22.0 [822a937]
v2.3.0
2.3.0
Interruptible Nodes and Timeouts
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.
Features
- Ginkgo now records any additional failures that occur during the cleanup of a failed spec. In prior versions this information was quietly discarded, but the introduction of a more rigorous approach to timeouts and interruptions allows Ginkgo to better track subsequent failures.
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 anEventually().WithContext()
assertion when a Progress Report is requested.- DescribeTable now exits with an error if it is not passed any Entries [a4c9865]
Fixes
- fixes crashes on newer Ruby 3 installations by upgrading github-pages gem dependency [92c88d5]
- Make the outline command able to use the DSL import [1be2427]
Maintenance
v2.2.0
2.2.0
Generate real-time Progress Reports [f91377c]
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.
Features
-
BeforeSuite
,AfterSuite
,SynchronizedBeforeSuite
,SynchronizedAfterSuite
, andReportAfterSuite
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.
Maintenance
v2.1.6
v2.1.5
2.1.5
Fixes
- drop -mod=mod instructions; fixes #1026 [6ad7138]
- Ensure
CurrentSpecReport
andAddReportEntry
are thread-safe [817c09b] - remove stale importmap gcflags flag test [3cd8b93]
- Always emit spec summary [5cf23e2] - even when only one spec has failed
- Fix ReportAfterSuite usage in docs [b1864ad]
- fixed typo (#997) [219cc00]
- TrimRight is not designed to trim Suffix [71ebb74]
- refactor: replace strings.Replace with strings.ReplaceAll (#978) [143d208]
- fix syntax in examples (#975) [b69554f]
Maintenance
- Bump github.com/onsi/gomega from 1.20.0 to 1.20.1 (#1027) [e5dfce4]
- Bump tzinfo from 1.2.9 to 1.2.10 in /docs (#1006) [7ae91c4]
- Bump github.com/onsi/gomega from 1.19.0 to 1.20.0 (#1005) [e87a85a]
- test: add new Go 1.19 to test matrix (#1014) [bbefe12]
- Bump golang.org/x/tools from 0.1.11 to 0.1.12 (#1012) [9327906]
- Bump golang.org/x/tools from 0.1.10 to 0.1.11 (#993) [f44af96]
- Bump nokogiri from 1.13.3 to 1.13.6 in /docs (#981) [ef336aa]
v2.1.4
Fixes
- Numerous documentation typos
- Prepend
when
when usingWhen
(this behavior was in 1.x but unintentionally lost during the 2.0 rewrite) [efce903] - improve error message when a parallel process fails to report back [a7bd1fe]
- guard against concurrent map writes in DeprecationTracker [0976569]
- Invoke reporting nodes during dry-run (fixes #956 and #935) [aae4480]
- Fix ginkgo import circle [f779385]
v2.1.3
v2.1.2
v2.1.1
v2.1.0
See https://onsi.github.io/ginkgo/MIGRATING_TO_V2 for details on V2.
2.1.0 is a minor release with a few tweaks: