Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit a9b6402

Browse files
committed
test: run OLM tests first, III
Top-level nodes were still getting randomized (onsi/ginkgo#966 (comment)).
1 parent 707d0dc commit a9b6402

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/e2e/deploy/deploy.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3333
"k8s.io/apimachinery/pkg/labels"
3434
"k8s.io/apimachinery/pkg/util/wait"
35+
"k8s.io/klog/v2"
3536
"k8s.io/klog/v2/klogr"
3637
"k8s.io/kubernetes/test/e2e/framework"
3738
"k8s.io/kubernetes/test/e2e/framework/skipper"
@@ -1511,7 +1512,19 @@ func Describe(deployment, describe, what string, f func(d *Deployment)) bool {
15111512
}
15121513

15131514
// DefineTests must be called to register all tests defined so far via Describe.
1515+
//
1516+
// They are placed inside a "Deploy" node because:
1517+
// - The order of specs inside a node is not randomized by default,
1518+
// which is what we want, in contrast to the top-level nodes,
1519+
// which always get randomized (https://github.com/onsi/ginkgo/issues/966#issuecomment-1110046593).
1520+
// - It is easier to focus on specific tests with, for example, "Deploy operator".
1521+
// "^operator" does not work because the internal test name string has some
1522+
// builtin, hidden string at the beginning (something like "top level").
15141523
func DefineTests() {
1524+
ginkgo.Context("Deploy", defineTests)
1525+
}
1526+
1527+
func defineTests() {
15151528
all := allDeployments[:]
15161529
for deploymentName := range tests {
15171530
if !haveDeployment(all, deploymentName) {
@@ -1527,6 +1540,7 @@ func DefineTests() {
15271540
deploymentName := deploymentName
15281541
for describe, funcs := range group {
15291542
funcs := funcs
1543+
klog.InfoS("defining tests", "deployment", deploymentName, "test", describe)
15301544
ginkgo.Describe(describe, func() {
15311545
var deployment *Deployment
15321546
if deploymentName != "" {

0 commit comments

Comments
 (0)