Repository navigation
Releases
Releases Β· onsi/ginkgo
v2.35.0
Features
InterceptSpecState(f)runsfand returns thetypes.SpecStateandtypes.FailurethatSkip,Fail(including failed assertions), orAbortSuiterecorded while it ran, without applying them to the current spec. This makes it possible to unit-test helpers that wrapSkipandFail. Every intercepted non-passing outcome is recorded on the spec as a report entry so it stays visible. See https://onsi.github.io/ginkgo/#testing-helpers-that-call-skip-or-fail Thanks @jghiloni for proposing it in #1693/#1694!
Fixes
- At long last - 13 years since it launched -
ginkgo -pnow runs plain Gotestingtests, Examples and fuzz seeds only on process 1, instead of once per process (which also duplicated an Example's output). When it compiles the suite the CLI asks the go command which test files are built, finds theTestfunction that callsRunSpecs- and records it in binaries built byginkgo build- and passes--test.run=^TestEntry$to processes 2..N. When the entrypoint can't be determined (RunSpecsbehind a helper in a package with severalTestfunctions or with aTestMain; a precompiled binary built with plaingo test -c, or byginkgo buildwhileGOFLAGSsets-ldflagsor with thepattern=argsform of--ldflags) or you pass your own-test.run,-test.skip,-test.benchor-test.fuzz, nothing is filtered, as before. SetGINKGO_RUN_GO_TESTS_ON_ALL_PROCSto any non-empty value to disable the filtering. If processes 2..N were filtered and then report nothing, the suite now fails with an error that names the entrypoint and this variable. - The Ginkgo CLI now fails a parallel suite when some processes started the suite but the CLI times out waiting for all of them to report back, even if every process exited cleanly. A suite that no process ever began (e.g. it calls
t.SkipbeforeRunSpecs) still passes. --no-coloris now honored by the messages the CLI and test processes print outside the reporters - the parallel "timed out waiting for all parallel procs to report back" report, the deprecation report, and configuration, validation and failure-message errors no longer contain ANSI escape codes.GinkgoRecoverno longer reports a spurious "Test Panicked" on a later spec when a goroutine'sFailis recovered after its node ended.- When Ginkgo reports a successful parallel suite but a process exits unsuccessfully (for example a failing Go
Example), the CLI now prints that process's output - once per distinct failure - instead of only "Test Suite Failed". Thanks @Boulea7! (#1696)
Maintenance
- Ginkgo's own test suite now passes when
GINKGO_NO_COLORis set, e.g. in distribution builds that rungo test. Thanks @businessdeveloper69! (#1695) - De-flaked load-sensitive timing specs in
internal/internal_integration. - Fixed a typo in the
GinkgoTdocs. Thanks @ninglinLiu! (#1692)
v2.34.0
Features
DeferOnFailureregisters a callback that runs only when a spec fails - as soon as the failing node returns and before any teardown (JustAfterEach,AfterEach,AfterAll,DeferCleanup) - so it can capture the state teardown is about to destroy. It takes exactly whatDeferCleanuptakes and shares its scoping: called inBeforeEach/JustBeforeEach/Itit covers the spec, inBeforeAllthe ordered container, and inBeforeSuitethe whole suite. It is also available onGinkgoT(); note that this adds a method toFullGinkgoTInterface, so hand-written implementations of that interface need to add it. See https://onsi.github.io/ginkgo/#capturing-failure-state-deferonfailure
Fixes
- Progress reporters (
AttachProgressReporter) are no longer called while Ginkgo holds an internal lock, so a reporter that callsCurrentSpecReport()orAddReportEntry()no longer stalls for 5 seconds and has its output dropped. --sleep-on-failurenow runs after anyDeferOnFailurecallbacks, also pauses when a spec times out, and no longer pauses if the suite has already been interrupted.
v2.33.1
Fixes
- Add several missing fields to spec report JSON output.
v2.33.0
Features
- The JUnit reporter now records each spec's
ReportEntrys as<properties>on its<testcase>element, with the entry's name and its JSON-encoded value. Thanks @pohly! [23db51a]
Maintenance
- Releases are now cut by a GitHub Actions workflow (Actions -> Release -> Run workflow) rather than by hand, with changelog entries collected under
## Unreleasedas the work happens. See RELEASING.md. [8616ecb]
v2.32.2
v2.32.1
v2.32.0
v2.31.0
v2.30.0
2.30.0
Features
Ginkgo now allows extentions/global.Reset to support running multiple suites from within a single process. This may take some massaging on your part (see 1672) but can dramatically speed up codebases with O(hundreds) of test suites.
Thanks @lawrencejones !
Fixes
- Fix nested --github-output group for progress report nested inside timeline [4f62d7a]
v2.29.0
2.29.0
GinkgoHelperGo makes it easier to write test helpers that need to run in goroutines. Specifically, it makes managing the failure state and capturing failure panics correctly straightforward.
ginkgo outline now includes entries defined in DescribeTableSubtree