Skip to content

Releases: onsi/ginkgo

v2.5.0

07 Nov 20:52
Compare
Choose a tag to compare

2.5.0

Ginkgo output now includes a timeline-view of the spec

This commit changes Ginkgo's default output. Spec details are now
presented as a timeline that includes events that occur during the spec
lifecycle interleaved with any GinkgoWriter content. This makes is much easier
to understand the flow of a spec and where a given failure occurs.

The --progress, --slow-spec-threshold, --always-emit-ginkgo-writer flags
and the SuppressProgressReporting decorator have all been deprecated. Instead
the existing -v and -vv flags better capture the level of verbosity to display. However,
a new --show-node-events flag is added to include node > Enter and < Exit events
in the spec timeline.

In addition, JUnit reports now include the timeline (rendered with -vv) and custom JUnit
reports can be configured and generated using
GenerateJUnitReportWithConfig(report types.Report, dst string, config JunitReportConfig)

Code should continue to work unchanged with this version of Ginkgo - however if you have tooling that
was relying on the specific output format of Ginkgo you may run into issues. Ginkgo's console output is not guaranteed to be stable for tooling and automation purposes. You should, instead, use Ginkgo's JSON format
to build tooling on top of as it has stronger guarantees to be stable from version to version.

Features

  • Provide details about which timeout expired [0f2fa27]

Fixes

  • Add Support Policy to docs [c70867a]

Maintenance

  • Bump github.com/onsi/gomega from 1.22.1 to 1.23.0 (#1070) [bb3b4e2]

v2.4.0

23 Oct 18:03
Compare
Choose a tag to compare

2.4.0

Features

  • DeferCleanup supports functions with multiple-return values [5e33c75]
  • Add GinkgoLogr (#1067) [bf78c28]
  • Introduction of 'MustPassRepeatedly' decorator (#1051) [047c02f]

Fixes

  • correcting some typos (#1064) [1403d3c]
  • fix flaky internal_integration interupt specs [2105ba3]
  • Correct busted link in README [be6b5b9]

Maintenance

v2.3.1

12 Oct 20:38
Compare
Choose a tag to compare

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

v2.3.0

11 Oct 19:34
Compare
Choose a tag to compare

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 an Eventually().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

  • chore(docs): delete no meaning d [57c373c]
  • chore(docs): Fix hyperlinks [30526d5]
  • chore(docs): fix code blocks without language settings [cf611c4]
  • fix intra-doc link [b541bcb]

v2.2.0

17 Sep 21:45
Compare
Choose a tag to compare

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, 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.

Maintenance

  • Modernize the invocation of Ginkgo in github actions [0ffde58]
  • Update reocmmended CI settings in docs [896bbb9]
  • Speed up unnecessarily slow integration test [6d3a90e]

v2.1.6

30 Aug 16:43
Compare
Choose a tag to compare

2.1.6

Fixes

  • Add SuppressProgressReporting decorator to turn off --progress announcements for a given node [dfef62a]
  • chore: remove duplicate word in comments [7373214]

v2.1.5

29 Aug 18:11
Compare
Choose a tag to compare

2.1.5

Fixes

  • drop -mod=mod instructions; fixes #1026 [6ad7138]
  • Ensure CurrentSpecReport and AddReportEntry 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

26 Apr 18:01
Compare
Choose a tag to compare

Fixes

  • Numerous documentation typos
  • Prepend when when using When (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

15 Feb 16:58
Compare
Choose a tag to compare

See https://onsi.github.io/ginkgo/MIGRATING_TO_V2 for details on V2.

Fixes

  • Calling By in a container node now emits a useful error. [ff12cee]

v2.1.2

11 Feb 19:51
Compare
Choose a tag to compare

Fixes

  • Track location of focused specs correctly in ginkgo unfocus [a612ff1]
  • Profiling suites with focused specs no longer generates an erroneous failure message [8fbfa02]
  • Several documentation typos fixed. Big thanks to everyone who helped catch them and report/fix them!