Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions pkg/test/ginkgo/cmd_runsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,20 +444,25 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
return strings.Contains(t.name, "[sig-network]")
})

networkEdgeTests, openshiftTests := splitTests(openshiftTests, func(t *testCase) bool {
return strings.Contains(t.name, "[sig-network-edge]")
})

buildsTests, openshiftTests := splitTests(openshiftTests, func(t *testCase) bool {
return strings.Contains(t.name, "[sig-builds]")
})

// separate from cliTests
mustGatherTests, openshiftTests := splitTests(openshiftTests, func(t *testCase) bool {
return strings.Contains(t.name, "[sig-cli] oc adm must-gather")
return strings.Contains(t.name, "[sig-cli] oc")
})

logrus.Infof("Found %d openshift tests", len(openshiftTests))
logrus.Infof("Found %d kubernetes tests", len(kubeTests))
logrus.Infof("Found %d storage tests", len(storageTests))
logrus.Infof("Found %d network k8s tests", len(networkK8sTests))
logrus.Infof("Found %d network tests", len(networkTests))
logrus.Infof("Found %d network edge tests", len(networkEdgeTests))
logrus.Infof("Found %d builds tests", len(buildsTests))
logrus.Infof("Found %d must-gather tests", len(mustGatherTests))

Expand All @@ -469,6 +474,7 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
originalStorage := storageTests
originalNetworkK8s := networkK8sTests
originalNetwork := networkTests
originalNetworkEdge := networkEdgeTests
originalBuilds := buildsTests
originalMustGather := mustGatherTests

Expand All @@ -478,11 +484,12 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
storageTests = append(storageTests, copyTests(originalStorage)...)
networkK8sTests = append(networkK8sTests, copyTests(originalNetworkK8s)...)
networkTests = append(networkTests, copyTests(originalNetwork)...)
networkEdgeTests = append(networkEdgeTests, copyTests(originalNetworkEdge)...)
buildsTests = append(buildsTests, copyTests(originalBuilds)...)
mustGatherTests = append(mustGatherTests, copyTests(originalMustGather)...)
}
}
expectedTestCount += len(openshiftTests) + len(kubeTests) + len(storageTests) + len(networkK8sTests) + len(networkTests) + len(buildsTests) + len(mustGatherTests)
expectedTestCount += len(openshiftTests) + len(kubeTests) + len(storageTests) + len(networkK8sTests) + len(networkTests) + len(networkEdgeTests) + len(buildsTests) + len(mustGatherTests)

abortFn := neverAbort
testCtx := ctx
Expand All @@ -504,6 +511,10 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
// we loop indefinitely.
for i := 0; (i < 1 || count == -1) && testCtx.Err() == nil; i++ {

openshiftTestsCopy := copyTests(openshiftTests)
q.Execute(testCtx, openshiftTestsCopy, parallelism, testOutputConfig, abortFn)
tests = append(tests, openshiftTestsCopy...)

kubeTestsCopy := copyTests(kubeTests)
q.Execute(testCtx, kubeTestsCopy, parallelism, testOutputConfig, abortFn)
tests = append(tests, kubeTestsCopy...)
Expand All @@ -525,14 +536,15 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
q.Execute(testCtx, buildsTestsCopy, max(1, parallelism/2), testOutputConfig, abortFn) // builds tests only run at half the parallelism, so we can avoid high cpu problems.
tests = append(tests, buildsTestsCopy...)

openshiftTestsCopy := copyTests(openshiftTests)
q.Execute(testCtx, openshiftTestsCopy, parallelism, testOutputConfig, abortFn)
tests = append(tests, openshiftTestsCopy...)

// run the must-gather tests after parallel tests to reduce resource contention
mustGatherTestsCopy := copyTests(mustGatherTests)
q.Execute(testCtx, mustGatherTestsCopy, parallelism, testOutputConfig, abortFn)
tests = append(tests, mustGatherTestsCopy...)

// run the network-edge tests last due to istio resources installed, lower parallelism to reduce resource contention
networkEdgeTestsCopy := copyTests(networkEdgeTests)
q.Execute(testCtx, networkEdgeTestsCopy, max(1, parallelism/2), testOutputConfig, abortFn)
tests = append(tests, networkEdgeTestsCopy...)
}

// TODO: will move to the monitor
Expand Down