You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: internal/ordering_test.go
+51-6
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@ package internal_test
2
2
3
3
import (
4
4
"strings"
5
+
"time"
5
6
6
7
. "github.com/onsi/ginkgo/v2"
7
8
. "github.com/onsi/gomega"
@@ -131,7 +132,6 @@ var _ = Describe("OrderSpecs", func() {
131
132
S(con2, N("G", ntIt, CL("file_B", 15))),
132
133
S(con2, N("H", ntIt, CL("file_B", 20))),
133
134
}
134
-
135
135
})
136
136
137
137
It("always generates a consistent randomization when given the same seed", func() {
@@ -279,15 +279,16 @@ var _ = Describe("OrderSpecs", func() {
279
279
Describe("presorting-specs", func() {
280
280
BeforeEach(func() {
281
281
conA0:=N(ntCon, CL("file-A", 1))
282
-
conA1:=N(ntCon, CL("file-A", 4))
282
+
conA1:=N(ntCon, Ordered, CL("file-A", 4))
283
283
conA2:=N(ntCon, CL("file-A", 10))
284
284
conB0:=N(ntCon, CL("file-B", 1))
285
285
conC0:=N(ntCon, CL("file-C", 1))
286
286
specs=Specs{
287
287
S(conA0, N("A", ntIt, CL("file-A", 2))),
288
288
S(conA0, N("B", ntIt, CL("file-A", 3))),
289
-
S(conA0, conA1, N("C", ntIt, CL("file-A", 5))),
290
-
S(conA0, conA1, N("D", ntIt, CL("file-A", 6))),
289
+
// C and D are generated by a helper function in a different file. if we aren't careful they would sort after E. But conA1 is an Ordered container so its important things run in the correct order
@@ -306,15 +307,59 @@ var _ = Describe("OrderSpecs", func() {
306
307
conf.RandomizeAllSpecs=false
307
308
})
308
309
309
-
It("ensures a deterministic order for specs that are defined at the same line without messing with the natural order of specs and containers", func() {
310
+
It("ensures a deterministic order for specs that are defined at the same line without messing with the natural order of specs and containers; it also ensures ordered containers run in the correct order - even if specs are generated in a helper function at a different line", func() {
310
311
conf.RandomSeed=1// this happens to sort conA0 ahead of conB0 - other than that, though, we are actually testing SortableSpecs
0 commit comments