Skip to content

Commit 392db3c

Browse files
committed
trt-2246: isolate network tests
1 parent ff53c94 commit 392db3c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pkg/test/ginkgo/cmd_runsuite.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
436436
return strings.Contains(t.name, "[sig-builds]")
437437
})
438438

439+
networkTests, openshiftTests := splitTests(openshiftTests, func(t *testCase) bool {
440+
return strings.Contains(t.name, "[sig-network]")
441+
})
442+
439443
mustGatherTests, openshiftTests := splitTests(openshiftTests, func(t *testCase) bool {
440444
return strings.Contains(t.name, "[sig-cli] oc adm must-gather")
441445
})
@@ -444,6 +448,7 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
444448
logrus.Infof("Found %d kube tests", len(kubeTests))
445449
logrus.Infof("Found %d storage tests", len(storageTests))
446450
logrus.Infof("Found %d builds tests", len(buildsTests))
451+
logrus.Infof("Found %d network tests", len(networkTests))
447452
logrus.Infof("Found %d must-gather tests", len(mustGatherTests))
448453

449454
// If user specifies a count, duplicate the kube and openshift tests that many times.
@@ -453,17 +458,19 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
453458
originalOpenshift := openshiftTests
454459
originalStorage := storageTests
455460
originalBuilds := buildsTests
461+
originalNetwork := networkTests
456462
originalMustGather := mustGatherTests
457463

458464
for i := 1; i < count; i++ {
459465
kubeTests = append(kubeTests, copyTests(originalKube)...)
460466
openshiftTests = append(openshiftTests, copyTests(originalOpenshift)...)
461467
storageTests = append(storageTests, copyTests(originalStorage)...)
462468
buildsTests = append(buildsTests, copyTests(originalBuilds)...)
469+
networkTests = append(networkTests, copyTests(originalNetwork)...)
463470
mustGatherTests = append(mustGatherTests, copyTests(originalMustGather)...)
464471
}
465472
}
466-
expectedTestCount += len(openshiftTests) + len(kubeTests) + len(storageTests) + len(mustGatherTests)
473+
expectedTestCount += len(openshiftTests) + len(kubeTests) + len(storageTests) + len(buildsTests) + len(networkTests) + len(mustGatherTests)
467474

468475
abortFn := neverAbort
469476
testCtx := ctx
@@ -497,6 +504,10 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
497504
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.
498505
tests = append(tests, buildsTestsCopy...)
499506

507+
networkTestsCopy := copyTests(networkTests)
508+
q.Execute(testCtx, networkTestsCopy, max(1, parallelism), testOutputConfig, abortFn) // run network tests separately.
509+
tests = append(tests, networkTestsCopy...)
510+
500511
openshiftTestsCopy := copyTests(openshiftTests)
501512
q.Execute(testCtx, openshiftTestsCopy, parallelism, testOutputConfig, abortFn)
502513
tests = append(tests, openshiftTestsCopy...)

0 commit comments

Comments
 (0)