Skip to content

Commit d6bba86

Browse files
committedJun 16, 2023
Programmatic focus is no longer overwrriten by CLI filters
1 parent 4a70a38 commit d6bba86

File tree

9 files changed

+160
-114
lines changed

9 files changed

+160
-114
lines changed
 

‎docs/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2597,8 +2597,8 @@ These mechanisms can all be used in concert. They combine with the following ru
25972597

25982598
- `Pending` specs are always pending and can never be coerced to run by another filtering mechanism.
25992599
- Specs that invoke `Skip()` will always be skipped regardless of other filtering mechanisms.
2600-
- The CLI based filters (`--label-filter`, `--focus-file/--skip-file`, `--focus/--skip`) **always** override any programmatic focus.
2601-
- When multiple CLI filters are provided they are all ANDed together. The spec must satisfy the label filter query **and** any location-based filters **and** any description based filters.
2600+
- Programmatic filters always apply and result in a non-zero exit code. Any additional CLI filters only apply to the subset of specs selected by the programmatic filters.
2601+
- When multiple CLI filters (`--label-filter`, `--focus-file/--skip-file`, `--focus/--skip`) are provided they are all ANDed together. The spec must satisfy the label filter query **and** any location-based filters **and** any description based filters.
26022602

26032603
### Repeating Spec Runs and Managing Flaky Specs
26042604

‎integration/_fixtures/filter_fixture/sprocket_c_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
. "github.com/onsi/ginkgo/v2"
55
)
66

7-
var _ = FDescribe("SprocketC", func() {
7+
var _ = Describe("SprocketC", func() {
88
It("cat", func() {
99

1010
})

‎integration/_fixtures/flags_fixture/flags_test.go

+36-46
Original file line numberDiff line numberDiff line change
@@ -18,66 +18,56 @@ func init() {
1818
}
1919

2020
var _ = Describe("Testing various flags", func() {
21-
FDescribe("the focused set", func() {
22-
It("should honor -cover", func() {
23-
Ω(Tested()).Should(Equal("tested"))
24-
})
25-
26-
It("should allow gcflags", func() {
27-
fmt.Printf("NaN returns %T\n", remapped.NaN())
28-
})
21+
It("should honor -cover", func() {
22+
Ω(Tested()).Should(Equal("tested"))
23+
})
2924

30-
PIt("should honor -failOnPending and -noisyPendings")
25+
It("should allow gcflags", func() {
26+
fmt.Printf("NaN returns %T\n", remapped.NaN())
27+
})
3128

32-
Describe("smores", func() {
33-
It("should honor -skip: marshmallow", func() {
34-
println("marshmallow")
35-
})
29+
PIt("should honor -failOnPending and -noisyPendings")
3630

37-
It("should honor -focus: chocolate", func() {
38-
println("chocolate")
39-
})
31+
Describe("smores", func() {
32+
It("should honor -skip: marshmallow", func() {
33+
println("marshmallow")
4034
})
4135

42-
It("should detect races", func() {
43-
var a string
44-
c := make(chan interface{}, 0)
45-
go func() {
46-
a = "now you don't"
47-
close(c)
48-
}()
49-
a = "now you see me"
50-
println(a)
51-
Eventually(c).Should(BeClosed())
36+
It("should honor -focus: chocolate", func() {
37+
println("chocolate")
5238
})
39+
})
5340

54-
It("should randomize A", func() {
55-
println("RANDOM_A")
56-
})
41+
It("should detect races", func() {
42+
var a string
43+
c := make(chan interface{}, 0)
44+
go func() {
45+
a = "now you don't"
46+
close(c)
47+
}()
48+
a = "now you see me"
49+
println(a)
50+
Eventually(c).Should(BeClosed())
51+
})
5752

58-
It("should randomize B", func() {
59-
println("RANDOM_B")
60-
})
53+
It("should randomize A", func() {
54+
println("RANDOM_A")
55+
})
6156

62-
It("should randomize C", func() {
63-
println("RANDOM_C")
64-
})
57+
It("should randomize B", func() {
58+
println("RANDOM_B")
59+
})
6560

66-
It("should pass in additional arguments after '--' directly to the test process", func() {
67-
fmt.Printf("CUSTOM_FLAG: %s", customFlag)
68-
})
61+
It("should randomize C", func() {
62+
println("RANDOM_C")
6963
})
7064

71-
Describe("more smores", func() {
72-
It("should not run these unless -focus is set", func() {
73-
println("smores")
74-
})
65+
It("should pass in additional arguments after '--' directly to the test process", func() {
66+
fmt.Printf("CUSTOM_FLAG: %s", customFlag)
7567
})
7668

77-
Describe("a failing test", func() {
78-
It("should fail", func() {
79-
Ω(true).Should(Equal(false))
80-
})
69+
It("should fail", func() {
70+
Ω(true).Should(Equal(false))
8171
})
8272

8373
Describe("a flaky test", func() {

‎integration/filter_test.go

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
package integration_test
22

33
import (
4-
"strings"
5-
64
. "github.com/onsi/ginkgo/v2"
75
. "github.com/onsi/gomega"
86
"github.com/onsi/gomega/gbytes"
97
"github.com/onsi/gomega/gexec"
108

119
. "github.com/onsi/ginkgo/v2/internal/test_helpers"
12-
"github.com/onsi/ginkgo/v2/types"
1310
)
1411

1512
var _ = Describe("Filter", func() {
@@ -76,14 +73,10 @@ var _ = Describe("Filter", func() {
7673
"--focus=", "--skip=",
7774
"--json-report=report.json",
7875
)
79-
Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
76+
Eventually(session).Should(gexec.Exit(0))
8077
specs := Reports(fm.LoadJSONReports("filter", "report.json")[0].SpecReports)
8178
for _, spec := range specs {
82-
if strings.HasPrefix(spec.FullText(), "SprocketC") {
83-
Ω(spec).Should(HavePassed())
84-
} else {
85-
Ω(spec).Should(Or(HaveBeenSkipped(), BePending()))
86-
}
79+
Ω(spec).Should(SatisfyAny(HavePassed(), BePending()))
8780
}
8881
})
8982

‎integration/flags_test.go

+10-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"strings"
55

66
. "github.com/onsi/ginkgo/v2"
7-
"github.com/onsi/ginkgo/v2/types"
87
. "github.com/onsi/gomega"
98
"github.com/onsi/gomega/gexec"
109
)
@@ -20,21 +19,20 @@ var _ = Describe("Flags Specs", func() {
2019

2120
It("normally passes, prints out noisy pendings, does not randomize tests, and honors the programmatic focus", func() {
2221
session := startGinkgo(fm.PathTo("flags"), "--no-color")
23-
Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
22+
Eventually(session).Should(gexec.Exit(1))
2423
output := string(session.Out.Contents())
2524

2625
Ω(output).Should(ContainSubstring("9 Passed"))
27-
Ω(output).Should(ContainSubstring("0 Failed"))
26+
Ω(output).Should(ContainSubstring("2 Failed"))
2827
Ω(output).Should(ContainSubstring("1 Pending"))
29-
Ω(output).Should(ContainSubstring("3 Skipped"))
28+
Ω(output).Should(ContainSubstring("0 Skipped"))
3029
Ω(output).Should(ContainSubstring("[PENDING]"))
3130
Ω(output).Should(ContainSubstring("marshmallow"))
3231
Ω(output).Should(ContainSubstring("chocolate"))
3332
Ω(output).Should(ContainSubstring("CUSTOM_FLAG: default"))
34-
Ω(output).Should(ContainSubstring("Detected Programmatic Focus - setting exit status to %d", types.GINKGO_FOCUS_EXIT_CODE))
35-
Ω(output).ShouldNot(ContainSubstring("smores"))
3633
Ω(output).ShouldNot(ContainSubstring("SLOW TEST"))
3734
Ω(output).ShouldNot(ContainSubstring("should honor -slow-spec-threshold"))
35+
Ω(output).ShouldNot(ContainSubstring("Full Stack Trace"))
3836

3937
orders := getRandomOrders(output)
4038
Ω(orders[0]).Should(BeNumerically("<", orders[1]))
@@ -53,15 +51,15 @@ var _ = Describe("Flags Specs", func() {
5351
Skip("race detection is not supported")
5452
}
5553
session := startGinkgo(fm.PathTo("flags"), "--no-color", "--race")
56-
Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
54+
Eventually(session).Should(gexec.Exit(1))
5755
output := string(session.Out.Contents())
5856

5957
Ω(output).Should(ContainSubstring("WARNING: DATA RACE"))
6058
})
6159

6260
It("should randomize tests when told to", func() {
63-
session := startGinkgo(fm.PathTo("flags"), "--no-color", "--randomize-all", "--seed=40")
64-
Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
61+
session := startGinkgo(fm.PathTo("flags"), "--no-color", "--randomize-all", "--seed=120")
62+
Eventually(session).Should(gexec.Exit(1))
6563
output := string(session.Out.Contents())
6664

6765
orders := getRandomOrders(output)
@@ -70,14 +68,14 @@ var _ = Describe("Flags Specs", func() {
7068

7169
It("should pass additional arguments in", func() {
7270
session := startGinkgo(fm.PathTo("flags"), "--", "--customFlag=madagascar")
73-
Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
71+
Eventually(session).Should(gexec.Exit(1))
7472
output := string(session.Out.Contents())
7573

7674
Ω(output).Should(ContainSubstring("CUSTOM_FLAG: madagascar"))
7775
})
7876

7977
It("should print out full stack traces for failures when told to", func() {
80-
session := startGinkgo(fm.PathTo("flags"), "--focus=a failing test", "--trace")
78+
session := startGinkgo(fm.PathTo("flags"), "--trace")
8179
Eventually(session).Should(gexec.Exit(1))
8280
output := string(session.Out.Contents())
8381

@@ -148,7 +146,7 @@ var _ = Describe("Flags Specs", func() {
148146

149147
It("should emit node start/end events when running with --show-node-events", func() {
150148
session := startGinkgo(fm.PathTo("flags"), "--no-color", "-v", "--show-node-events")
151-
Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
149+
Eventually(session).Should(gexec.Exit(1))
152150
output := string(session.Out.Contents())
153151

154152
Eventually(output).Should(ContainSubstring("> Enter [It] should honor -cover"))

‎internal/focus.go

+34-37
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ import (
88
)
99

1010
/*
11-
If a container marked as focus has a descendant that is also marked as focus, Ginkgo's policy is to
12-
unmark the container's focus. This gives developers a more intuitive experience when debugging specs.
13-
It is common to focus a container to just run a subset of specs, then identify the specific specs within the container to focus -
14-
this policy allows the developer to simply focus those specific specs and not need to go back and turn the focus off of the container:
15-
16-
As a common example, consider:
17-
18-
FDescribe("something to debug", function() {
19-
It("works", function() {...})
20-
It("works", function() {...})
21-
FIt("doesn't work", function() {...})
22-
It("works", function() {...})
23-
})
24-
25-
here the developer's intent is to focus in on the `"doesn't work"` spec and not to run the adjacent specs in the focused `"something to debug"` container.
26-
The nested policy applied by this function enables this behavior.
11+
If a container marked as focus has a descendant that is also marked as focus, Ginkgo's policy is to
12+
unmark the container's focus. This gives developers a more intuitive experience when debugging specs.
13+
It is common to focus a container to just run a subset of specs, then identify the specific specs within the container to focus -
14+
this policy allows the developer to simply focus those specific specs and not need to go back and turn the focus off of the container:
15+
16+
As a common example, consider:
17+
18+
FDescribe("something to debug", function() {
19+
It("works", function() {...})
20+
It("works", function() {...})
21+
FIt("doesn't work", function() {...})
22+
It("works", function() {...})
23+
})
24+
25+
here the developer's intent is to focus in on the `"doesn't work"` spec and not to run the adjacent specs in the focused `"something to debug"` container.
26+
The nested policy applied by this function enables this behavior.
2727
*/
2828
func ApplyNestedFocusPolicyToTree(tree *TreeNode) {
2929
var walkTree func(tree *TreeNode) bool
@@ -44,46 +44,43 @@ func ApplyNestedFocusPolicyToTree(tree *TreeNode) {
4444
}
4545

4646
/*
47-
Ginkgo supports focussing specs using `FIt`, `FDescribe`, etc. - this is called "programmatic focus"
48-
It also supports focussing specs using regular expressions on the command line (`-focus=`, `-skip=`) that match against spec text
49-
and file filters (`-focus-files=`, `-skip-files=`) that match against code locations for nodes in specs.
47+
Ginkgo supports focussing specs using `FIt`, `FDescribe`, etc. - this is called "programmatic focus"
48+
It also supports focussing specs using regular expressions on the command line (`-focus=`, `-skip=`) that match against spec text and file filters (`-focus-files=`, `-skip-files=`) that match against code locations for nodes in specs.
5049
51-
If any of the CLI flags are provided they take precedence. The file filters run first followed by the regex filters.
50+
When both programmatic and file filters are provided their results are ANDed together. If multiple kinds of filters are provided, the file filters run first followed by the regex filters.
5251
53-
This function sets the `Skip` property on specs by applying Ginkgo's focus policy:
54-
- If there are no CLI arguments and no programmatic focus, do nothing.
55-
- If there are no CLI arguments but a spec somewhere has programmatic focus, skip any specs that have no programmatic focus.
56-
- If there are CLI arguments parse them and skip any specs that either don't match the focus filters or do match the skip filters.
52+
This function sets the `Skip` property on specs by applying Ginkgo's focus policy:
53+
- If there are no CLI arguments and no programmatic focus, do nothing.
54+
- If a spec somewhere has programmatic focus skip any specs that have no programmatic focus.
55+
- If there are CLI arguments parse them and skip any specs that either don't match the focus filters or do match the skip filters.
5756
58-
*Note:* specs with pending nodes are Skipped when created by NewSpec.
57+
*Note:* specs with pending nodes are Skipped when created by NewSpec.
5958
*/
6059
func ApplyFocusToSpecs(specs Specs, description string, suiteLabels Labels, suiteConfig types.SuiteConfig) (Specs, bool) {
6160
focusString := strings.Join(suiteConfig.FocusStrings, "|")
6261
skipString := strings.Join(suiteConfig.SkipStrings, "|")
6362

64-
hasFocusCLIFlags := focusString != "" || skipString != "" || len(suiteConfig.SkipFiles) > 0 || len(suiteConfig.FocusFiles) > 0 || suiteConfig.LabelFilter != ""
65-
6663
type SkipCheck func(spec Spec) bool
6764

6865
// by default, skip any specs marked pending
6966
skipChecks := []SkipCheck{func(spec Spec) bool { return spec.Nodes.HasNodeMarkedPending() }}
7067
hasProgrammaticFocus := false
7168

72-
if !hasFocusCLIFlags {
73-
// check for programmatic focus
74-
for _, spec := range specs {
75-
if spec.Nodes.HasNodeMarkedFocus() && !spec.Nodes.HasNodeMarkedPending() {
76-
skipChecks = append(skipChecks, func(spec Spec) bool { return !spec.Nodes.HasNodeMarkedFocus() })
77-
hasProgrammaticFocus = true
78-
break
79-
}
69+
for _, spec := range specs {
70+
if spec.Nodes.HasNodeMarkedFocus() && !spec.Nodes.HasNodeMarkedPending() {
71+
hasProgrammaticFocus = true
72+
break
8073
}
8174
}
8275

76+
if hasProgrammaticFocus {
77+
skipChecks = append(skipChecks, func(spec Spec) bool { return !spec.Nodes.HasNodeMarkedFocus() })
78+
}
79+
8380
if suiteConfig.LabelFilter != "" {
8481
labelFilter, _ := types.ParseLabelFilter(suiteConfig.LabelFilter)
85-
skipChecks = append(skipChecks, func(spec Spec) bool {
86-
return !labelFilter(UnionOfLabels(suiteLabels, spec.Nodes.UnionOfLabels()))
82+
skipChecks = append(skipChecks, func(spec Spec) bool {
83+
return !labelFilter(UnionOfLabels(suiteLabels, spec.Nodes.UnionOfLabels()))
8784
})
8885
}
8986

‎internal/focus_test.go

+31-4
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ var _ = Describe("Focus", func() {
155155
S(N("green dragon"), N()),
156156
S(N(Pending), N("blue Dragon")),
157157
S(N("yellow dragon")),
158-
S(N(Focus, "yellow dragon")),
158+
S(N("yellow dragon")),
159159
}
160160
})
161161

@@ -218,7 +218,7 @@ var _ = Describe("Focus", func() {
218218
S(N(CL("file_b", 3, "file_b", 15))), //include because "file_:15-21" is in FocusFiles
219219
S(N(CL("file_b", 17))), //skip because "_b:17" is in SkipFiles
220220
S(N(CL("file_b", 20), Pending)), //skip because spec is flagged pending
221-
S(N(CL("c", 3), Focus)), //skip because "c" is not in FocusFiles - override programmatic focus
221+
S(N(CL("c", 3))), //skip because "c" is not in FocusFiles
222222
S(N(CL("d", 17))), //include because "d " is in FocusFiles
223223
}
224224

@@ -240,7 +240,7 @@ var _ = Describe("Focus", func() {
240240
S(N(ntCon, Label("cat", "dog")), N(ntIt, "A", Label("fish"))), //skip because fish
241241
S(N(ntCon, Label("cat", "dog")), N(ntIt, "B", Label("apple"))), //include because has cat and not fish
242242
S(N(ntCon, Label("dog")), N(ntIt, "C", Label("apple"))), //skip because no cat or cow
243-
S(N(ntCon, Label("cow")), N(ntIt, "D", Label("fish"), Focus)), //skip because fish, override focus
243+
S(N(ntCon, Label("cow")), N(ntIt, "D", Label("fish"))), //skip because fish
244244
S(N(ntCon, Label("cow")), N(ntIt, "E")), //include because cow and no fish
245245
S(N(ntCon, Label("cow")), N(ntIt, "F", Pending)), //skip because pending
246246
}
@@ -277,7 +277,7 @@ var _ = Describe("Focus", func() {
277277
S(N("dog cat", CL("file_b", 3, "file_b", 15), Label("brown"))), //skip because "file_:15-21" is in FocusFiles but "cat" is in SkipStirngs
278278
S(N("fish", CL("file_b", 17), Label("brown"))), //skip because "_b:17" is in SkipFiles, even though "fish" is in FocusStrings
279279
S(N("biscuit", CL("file_b", 20), Pending, Label("brown"))), //skip because spec is flagged pending
280-
S(N("pony", CL("c", 3), Focus, Label("brown"))), //skip because "c" is not in FocusFiles or FocusStrings - override programmatic focus
280+
S(N("pony", CL("c", 3), Label("brown"))), //skip because "c" is not in FocusFiles or FocusStrings
281281
S(N("goat", CL("d", 17), Label("brown"))), //skip because "goat" is in FocusStrings but "d" is not in FocusFiles
282282
}
283283

@@ -294,5 +294,32 @@ var _ = Describe("Focus", func() {
294294
Ω(hasProgrammaticFocus).Should(BeFalse())
295295
})
296296
})
297+
298+
Context("when configured with focus/skip files, focus/skip strings, and label filters and there is a programmatic focus", func() {
299+
BeforeEach(func() {
300+
specs = Specs{
301+
S(N("dog", CL("file_a", 1), Label("brown"))), //skip because "file_:1" is in FocusFiles and "dog" is in FocusStrings and has "brown" label but a different spec has a programmatic focus
302+
S(N("dog", CL("file_a", 17), Label("brown"), Focus)), //include because "file_:15-21" is in FocusFiles and "dog" is in FocusStrings and has "brown" label
303+
S(N("dog", CL("file_a", 1), Label("white"), Focus)), //skip because does not have "brown" label
304+
S(N("dog cat", CL("file_b", 3, "file_b", 15), Label("brown"))), //skip because "file_:15-21" is in FocusFiles but "cat" is in SkipStirngs
305+
S(N("fish", CL("file_b", 17), Label("brown"))), //skip because "_b:17" is in SkipFiles, even though "fish" is in FocusStrings
306+
S(N("biscuit", CL("file_b", 20), Pending, Label("brown"))), //skip because spec is flagged pending
307+
S(N("pony", CL("c", 3), Label("brown"))), //skip because "c" is not in FocusFiles or FocusStrings
308+
S(N("goat", CL("d", 17), Label("brown"))), //skip because "goat" is in FocusStrings but "d" is not in FocusFiles
309+
}
310+
311+
conf.FocusFiles = []string{"file_:1,15-21"}
312+
conf.SkipFiles = []string{"_b:17"}
313+
conf.FocusStrings = []string{"goat", "dog", "fish", "biscuit"}
314+
conf.SkipStrings = []string{"cat"}
315+
conf.LabelFilter = "brown"
316+
})
317+
318+
It("applies all filters", func() {
319+
specs, hasProgrammaticFocus := internal.ApplyFocusToSpecs(specs, description, suiteLabels, conf)
320+
Ω(harvestSkips(specs)).Should(Equal([]bool{true, false, true, true, true, true, true, true}))
321+
Ω(hasProgrammaticFocus).Should(BeTrue())
322+
})
323+
})
297324
})
298325
})

‎internal/internal_integration/focus_test.go

+43-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ var _ = Describe("Focus", func() {
122122
BeforeEach(func() {
123123
conf.FocusStrings = []string{"blue", "green"}
124124
conf.SkipStrings = []string{"red"}
125-
success, _ := RunFixture("cli focus tests", func() {
125+
success, hasProgrammaticFocus := RunFixture("cli focus tests", func() {
126126
It("blue.1", rt.T("blue.1"))
127127
It("blue.2", rt.T("blue.2"))
128128
Describe("blue.container", func() {
@@ -137,9 +137,10 @@ var _ = Describe("Focus", func() {
137137
Describe("red.2", func() {
138138
It("green.2", rt.T("green.2"))
139139
})
140-
FIt("red.3", rt.T("red.3"))
140+
It("red.3", rt.T("red.3"))
141141
})
142142
Ω(success).Should(BeTrue())
143+
Ω(hasProgrammaticFocus).Should(BeFalse())
143144
})
144145

145146
It("should run tests that match", func() {
@@ -157,6 +158,46 @@ var _ = Describe("Focus", func() {
157158
})
158159
})
159160

161+
Describe("with a combination of programmatic focus and config.FocusStrings and config.SkipStrings", func() {
162+
BeforeEach(func() {
163+
conf.FocusStrings = []string{"blue", "green"}
164+
conf.SkipStrings = []string{"red"}
165+
success, hasProgrammaticFocus := RunFixture("cli focus tests", func() {
166+
It("blue.1", rt.T("blue.1"))
167+
FIt("blue.2", rt.T("blue.2"))
168+
FDescribe("blue.container", func() {
169+
It("yellow.1", rt.T("yellow.1"))
170+
It("red.1", rt.T("red.1"))
171+
PIt("blue.3", rt.T("blue.3"))
172+
})
173+
Describe("green.container", func() {
174+
It("yellow.2", rt.T("yellow.2"))
175+
It("green.1", rt.T("green.1"))
176+
})
177+
FDescribe("red.2", func() {
178+
It("green.2", rt.T("green.2"))
179+
})
180+
FIt("red.3", rt.T("red.3"))
181+
})
182+
Ω(success).Should(BeTrue())
183+
Ω(hasProgrammaticFocus).Should(BeTrue())
184+
})
185+
186+
It("should run tests that match all the filters", func() {
187+
Ω(rt.TrackedRuns()).Should(ConsistOf("blue.2", "yellow.1"))
188+
})
189+
190+
It("should report on the tests correctly", func() {
191+
Ω(reporter.Did.WithState(types.SpecStateSkipped).Names()).Should(ConsistOf("blue.1", "red.1", "yellow.2", "green.1", "green.2", "red.3"))
192+
Ω(reporter.Did.WithState(types.SpecStatePending).Names()).Should(ConsistOf("blue.3"))
193+
Ω(reporter.Did.WithState(types.SpecStatePassed).Names()).Should(ConsistOf("blue.2", "yellow.1"))
194+
})
195+
196+
It("report on the suite with accurate numbers", func() {
197+
Ω(reporter.End).Should(BeASuiteSummary(true, NPassed(2), NSkipped(6), NPending(1), NSpecs(9), NWillRun(2)))
198+
})
199+
})
200+
160201
Describe("when no tests will end up running", func() {
161202
BeforeEach(func() {
162203
conf.FocusStrings = []string{"red"}

‎internal/internal_integration/labels_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var _ = Describe("Labels", func() {
1212
Describe("when a suite has labelled tests", func() {
1313
fixture := func() {
1414
Describe("outer container", func() {
15-
It("A", rt.T("A"), Focus, Label("cat"))
15+
It("A", rt.T("A"), Label("cat"))
1616
It("B", rt.T("B"), Label("dog"))
1717
Describe("container", Label("cow", "cat"), func() {
1818
It("C", rt.T("C"))

0 commit comments

Comments
 (0)
Please sign in to comment.