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

Commit

Permalink
test: run OLM tests first, III
Browse files Browse the repository at this point in the history
Top-level nodes were still getting
randomized (onsi/ginkgo#966 (comment)).
  • Loading branch information
pohly committed Apr 27, 2022
1 parent 707d0dc commit a9b6402
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/e2e/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog/v2"
"k8s.io/klog/v2/klogr"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework/skipper"
Expand Down Expand Up @@ -1511,7 +1512,19 @@ func Describe(deployment, describe, what string, f func(d *Deployment)) bool {
}

// DefineTests must be called to register all tests defined so far via Describe.
//
// They are placed inside a "Deploy" node because:
// - The order of specs inside a node is not randomized by default,
// which is what we want, in contrast to the top-level nodes,
// which always get randomized (https://github.com/onsi/ginkgo/issues/966#issuecomment-1110046593).
// - It is easier to focus on specific tests with, for example, "Deploy operator".
// "^operator" does not work because the internal test name string has some
// builtin, hidden string at the beginning (something like "top level").
func DefineTests() {
ginkgo.Context("Deploy", defineTests)
}

func defineTests() {
all := allDeployments[:]
for deploymentName := range tests {
if !haveDeployment(all, deploymentName) {
Expand All @@ -1527,6 +1540,7 @@ func DefineTests() {
deploymentName := deploymentName
for describe, funcs := range group {
funcs := funcs
klog.InfoS("defining tests", "deployment", deploymentName, "test", describe)
ginkgo.Describe(describe, func() {
var deployment *Deployment
if deploymentName != "" {
Expand Down

0 comments on commit a9b6402

Please sign in to comment.