forked from onsi/ginkgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_fail_fast_test.go
50 lines (43 loc) · 1.33 KB
/
config_fail_fast_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package internal_integration_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/ginkgo/v2/internal/test_helpers"
. "github.com/onsi/gomega"
)
var _ = Describe("when config.FailFast is enabled", func() {
BeforeEach(func() {
SetUpForParallel(2)
conf.FailFast = true
Ω(client.ShouldAbort()).Should(BeFalse())
RunFixture("fail fast", func() {
Describe("a container", func() {
BeforeEach(rt.T("bef"))
It("A", rt.T("A"))
It("B", rt.T("B", func() { F() }))
It("C", rt.T("C", func() { F() }))
It("D", rt.T("D"))
AfterEach(rt.T("aft"))
})
AfterSuite(rt.T("after-suite"))
})
})
It("does not run any tests after the failure occurs, but does run the failed tests's after each and the after suite", func() {
Ω(rt).Should(HaveTracked(
"bef", "A", "aft",
"bef", "B", "aft",
"after-suite",
))
})
It("reports that the tests were skipped", func() {
Ω(reporter.Did.Find("A")).Should(HavePassed())
Ω(reporter.Did.Find("B")).Should(HaveFailed())
Ω(reporter.Did.Find("C")).Should(HaveBeenSkipped())
Ω(reporter.Did.Find("D")).Should(HaveBeenSkipped())
})
It("reports the correct statistics", func() {
Ω(reporter.End).Should(BeASuiteSummary(NSpecs(4), NPassed(1), NFailed(1), NSkipped(2)))
})
It("tells the server to abort", func() {
Ω(client.ShouldAbort()).Should(BeTrue())
})
})