Skip to content

Commit fdb6c47

Browse files
committed
v2.5.0
1 parent db83f33 commit fdb6c47

File tree

3 files changed

+59
-31
lines changed

3 files changed

+59
-31
lines changed

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
## 2.5.0
2+
3+
### Ginkgo output now includes a timeline-view of the spec
4+
5+
This commit changes Ginkgo's default output. Spec details are now
6+
presented as a **timeline** that includes events that occur during the spec
7+
lifecycle interleaved with any GinkgoWriter content. This makes is much easier
8+
to understand the flow of a spec and where a given failure occurs.
9+
10+
The --progress, --slow-spec-threshold, --always-emit-ginkgo-writer flags
11+
and the SuppressProgressReporting decorator have all been deprecated. Instead
12+
the existing -v and -vv flags better capture the level of verbosity to display. However,
13+
a new --show-node-events flag is added to include node `> Enter` and `< Exit` events
14+
in the spec timeline.
15+
16+
In addition, JUnit reports now include the timeline (rendered with -vv) and custom JUnit
17+
reports can be configured and generated using
18+
`GenerateJUnitReportWithConfig(report types.Report, dst string, config JunitReportConfig)`
19+
20+
Code should continue to work unchanged with this version of Ginkgo - however if you have tooling that
21+
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
22+
to build tooling on top of as it has stronger guarantees to be stable from version to version.
23+
24+
### Features
25+
- Provide details about which timeout expired [0f2fa27]
26+
27+
### Fixes
28+
- Add Support Policy to docs [c70867a]
29+
30+
### Maintenance
31+
- Bump github.com/onsi/gomega from 1.22.1 to 1.23.0 (#1070) [bb3b4e2]
32+
133
## 2.4.0
234

335
### Features

README.md

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
---
66

7-
# Ginkgo 2.0 is now Generally Available!
8-
9-
You can learn more about 2.0 in the [Migration Guide](https://onsi.github.io/ginkgo/MIGRATING_TO_V2)!
10-
11-
---
7+
# Ginkgo
128

139
Ginkgo is a mature testing framework for Go designed to help you write expressive specs. Ginkgo builds on top of Go's `testing` foundation and is complemented by the [Gomega](https://github.com/onsi/gomega) matcher library. Together, Ginkgo and Gomega let you express the intent behind your specs clearly:
1410

@@ -33,53 +29,53 @@ Describe("Checking books out of the library", Label("library"), func() {
3329
})
3430

3531
When("the library has the book in question", func() {
36-
BeforeEach(func() {
37-
Expect(library.Store(book)).To(Succeed())
32+
BeforeEach(func(ctx SpecContext) {
33+
Expect(library.Store(ctx, book)).To(Succeed())
3834
})
3935

4036
Context("and the book is available", func() {
41-
It("lends it to the reader", func() {
42-
Expect(valjean.Checkout(library, "Les Miserables")).To(Succeed())
37+
It("lends it to the reader", func(ctx SpecContext) {
38+
Expect(valjean.Checkout(ctx, library, "Les Miserables")).To(Succeed())
4339
Expect(valjean.Books()).To(ContainElement(book))
44-
Expect(library.UserWithBook(book)).To(Equal(valjean))
45-
})
40+
Expect(library.UserWithBook(ctx, book)).To(Equal(valjean))
41+
}, SpecTimeout(time.Second * 5))
4642
})
4743

4844
Context("but the book has already been checked out", func() {
4945
var javert *users.User
50-
BeforeEach(func() {
46+
BeforeEach(func(ctx SpecContext) {
5147
javert = users.NewUser("Javert")
52-
Expect(javert.Checkout(library, "Les Miserables")).To(Succeed())
48+
Expect(javert.Checkout(ctx, library, "Les Miserables")).To(Succeed())
5349
})
5450

55-
It("tells the user", func() {
56-
err := valjean.Checkout(library, "Les Miserables")
51+
It("tells the user", func(ctx SpecContext) {
52+
err := valjean.Checkout(ctx, library, "Les Miserables")
5753
Expect(error).To(MatchError("Les Miserables is currently checked out"))
58-
})
54+
}, SpecTimeout(time.Second * 5))
5955

60-
It("lets the user place a hold and get notified later", func() {
61-
Expect(valjean.Hold(library, "Les Miserables")).To(Succeed())
62-
Expect(valjean.Holds()).To(ContainElement(book))
56+
It("lets the user place a hold and get notified later", func(ctx SpecContext) {
57+
Expect(valjean.Hold(ctx, library, "Les Miserables")).To(Succeed())
58+
Expect(valjean.Holds(ctx)).To(ContainElement(book))
6359

6460
By("when Javert returns the book")
65-
Expect(javert.Return(library, book)).To(Succeed())
61+
Expect(javert.Return(ctx, library, book)).To(Succeed())
6662

6763
By("it eventually informs Valjean")
6864
notification := "Les Miserables is ready for pick up"
69-
Eventually(valjean.Notifications).Should(ContainElement(notification))
65+
Eventually(ctx, valjean.Notifications).Should(ContainElement(notification))
7066

71-
Expect(valjean.Checkout(library, "Les Miserables")).To(Succeed())
72-
Expect(valjean.Books()).To(ContainElement(book))
73-
Expect(valjean.Holds()).To(BeEmpty())
74-
})
67+
Expect(valjean.Checkout(ctx, library, "Les Miserables")).To(Succeed())
68+
Expect(valjean.Books(ctx)).To(ContainElement(book))
69+
Expect(valjean.Holds(ctx)).To(BeEmpty())
70+
}, SpecTimeout(time.Second * 10))
7571
})
7672
})
7773

7874
When("the library does not have the book in question", func() {
79-
It("tells the reader the book is unavailable", func() {
80-
err := valjean.Checkout(library, "Les Miserables")
75+
It("tells the reader the book is unavailable", func(ctx SpecContext) {
76+
err := valjean.Checkout(ctx, library, "Les Miserables")
8177
Expect(error).To(MatchError("Les Miserables is not in the library catalog"))
82-
})
78+
}, SpecTimeout(time.Second * 5))
8379
})
8480
})
8581
```
@@ -92,15 +88,15 @@ If you have a question, comment, bug report, feature request, etc. please open a
9288

9389
Whether writing basic unit specs, complex integration specs, or even performance specs - Ginkgo gives you an expressive Domain-Specific Language (DSL) that will be familiar to users coming from frameworks such as [Quick](https://github.com/Quick/Quick), [RSpec](https://rspec.info), [Jasmine](https://jasmine.github.io), and [Busted](https://lunarmodules.github.io/busted/). This style of testing is sometimes referred to as "Behavior-Driven Development" (BDD) though Ginkgo's utility extends beyond acceptance-level testing.
9490

95-
With Ginkgo's DSL you can use nestable [`Describe`, `Context` and `When` container nodes](https://onsi.github.io/ginkgo/#organizing-specs-with-container-nodes) to help you organize your specs. [`BeforeEach` and `AfterEach` setup nodes](https://onsi.github.io/ginkgo/#extracting-common-setup-beforeeach) for setup and cleanup. [`It` and `Specify` subject nodes](https://onsi.github.io/ginkgo/#spec-subjects-it) that hold your assertions. [`BeforeSuite` and `AfterSuite` nodes](https://onsi.github.io/ginkgo/#suite-setup-and-cleanup-beforesuite-and-aftersuite) to prep for and cleanup after a suite... and [much more!](https://onsi.github.io/ginkgo/#writing-specs)
91+
With Ginkgo's DSL you can use nestable [`Describe`, `Context` and `When` container nodes](https://onsi.github.io/ginkgo/#organizing-specs-with-container-nodes) to help you organize your specs. [`BeforeEach` and `AfterEach` setup nodes](https://onsi.github.io/ginkgo/#extracting-common-setup-beforeeach) for setup and cleanup. [`It` and `Specify` subject nodes](https://onsi.github.io/ginkgo/#spec-subjects-it) that hold your assertions. [`BeforeSuite` and `AfterSuite` nodes](https://onsi.github.io/ginkgo/#suite-setup-and-cleanup-beforesuite-and-aftersuite) to prep for and cleanup after a suite... and [much more!](https://onsi.github.io/ginkgo/#writing-specs).
9692

9793
At runtime, Ginkgo can run your specs in reproducibly [random order](https://onsi.github.io/ginkgo/#spec-randomization) and has sophisticated support for [spec parallelization](https://onsi.github.io/ginkgo/#spec-parallelization). In fact, running specs in parallel is as easy as
9894

9995
```bash
10096
ginkgo -p
10197
```
10298

103-
By following [established patterns for writing parallel specs](https://onsi.github.io/ginkgo/#patterns-for-parallel-integration-specs) you can build even large, complex integration suites that parallelize cleanly and run performantly.
99+
By following [established patterns for writing parallel specs](https://onsi.github.io/ginkgo/#patterns-for-parallel-integration-specs) you can build even large, complex integration suites that parallelize cleanly and run performantly. And you don't have to worry about your spec suite hanging or leaving a mess behind - Ginkgo provides a per-node `context.Context` and the capability to interrupt the spec after a set period of time - and then clean up.
104100

105101
As your suites grow Ginkgo helps you keep your specs organized with [labels](https://onsi.github.io/ginkgo/#spec-labels) and lets you easily run [subsets of specs](https://onsi.github.io/ginkgo/#filtering-specs), either [programmatically](https://onsi.github.io/ginkgo/#focused-specs) or on the [command line](https://onsi.github.io/ginkgo/#combining-filters). And Ginkgo's reporting infrastructure generates machine-readable output in a [variety of formats](https://onsi.github.io/ginkgo/#generating-machine-readable-reports) _and_ allows you to build your own [custom reporting infrastructure](https://onsi.github.io/ginkgo/#generating-reports-programmatically).
106102

types/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package types
22

3-
const VERSION = "2.4.0"
3+
const VERSION = "2.5.0"

0 commit comments

Comments
 (0)