Skip to content

Commit 80bfed3

Browse files
Merge pull request #30192 from neisw/trt-2246-network-test-isolation
Trt-2246: network test isolation
2 parents a5edd03 + 9e6910f commit 80bfed3

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

pkg/test/ginkgo/cmd_runsuite.go

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,14 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
424424
return strings.Contains(t.name, "[sig-storage]")
425425
})
426426

427+
networkK8sTests, kubeTests := splitTests(kubeTests, func(t *testCase) bool {
428+
return strings.Contains(t.name, "[sig-network]")
429+
})
430+
431+
networkTests, openshiftTests := splitTests(openshiftTests, func(t *testCase) bool {
432+
return strings.Contains(t.name, "[sig-network]")
433+
})
434+
427435
buildsTests, openshiftTests := splitTests(openshiftTests, func(t *testCase) bool {
428436
return strings.Contains(t.name, "[sig-builds]")
429437
})
@@ -435,6 +443,8 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
435443
logrus.Infof("Found %d openshift tests", len(openshiftTests))
436444
logrus.Infof("Found %d kube tests", len(kubeTests))
437445
logrus.Infof("Found %d storage tests", len(storageTests))
446+
logrus.Infof("Found %d network k8s tests", len(networkK8sTests))
447+
logrus.Infof("Found %d network tests", len(networkTests))
438448
logrus.Infof("Found %d builds tests", len(buildsTests))
439449
logrus.Infof("Found %d must-gather tests", len(mustGatherTests))
440450

@@ -444,18 +454,22 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
444454
originalKube := kubeTests
445455
originalOpenshift := openshiftTests
446456
originalStorage := storageTests
457+
originalNetworkK8s := networkK8sTests
458+
originalNetwork := networkTests
447459
originalBuilds := buildsTests
448460
originalMustGather := mustGatherTests
449461

450462
for i := 1; i < count; i++ {
451463
kubeTests = append(kubeTests, copyTests(originalKube)...)
452464
openshiftTests = append(openshiftTests, copyTests(originalOpenshift)...)
453465
storageTests = append(storageTests, copyTests(originalStorage)...)
466+
networkK8sTests = append(networkK8sTests, copyTests(originalNetworkK8s)...)
467+
networkTests = append(networkTests, copyTests(originalNetwork)...)
454468
buildsTests = append(buildsTests, copyTests(originalBuilds)...)
455469
mustGatherTests = append(mustGatherTests, copyTests(originalMustGather)...)
456470
}
457471
}
458-
expectedTestCount += len(openshiftTests) + len(kubeTests) + len(storageTests) + len(buildsTests) + len(mustGatherTests)
472+
expectedTestCount += len(openshiftTests) + len(kubeTests) + len(storageTests) + len(networkK8sTests) + len(networkTests) + len(buildsTests) + len(mustGatherTests)
459473

460474
abortFn := neverAbort
461475
testCtx := ctx
@@ -485,6 +499,14 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
485499
q.Execute(testCtx, storageTestsCopy, max(1, parallelism/2), testOutputConfig, abortFn) // storage tests only run at half the parallelism, so we can avoid cloud provider quota problems.
486500
tests = append(tests, storageTestsCopy...)
487501

502+
networkK8sTestsCopy := copyTests(networkK8sTests)
503+
q.Execute(testCtx, networkK8sTestsCopy, max(1, parallelism/2), testOutputConfig, abortFn) // run network tests separately.
504+
tests = append(tests, networkK8sTestsCopy...)
505+
506+
networkTestsCopy := copyTests(networkTests)
507+
q.Execute(testCtx, networkTestsCopy, max(1, parallelism/2), testOutputConfig, abortFn) // run network tests separately.
508+
tests = append(tests, networkTestsCopy...)
509+
488510
buildsTestsCopy := copyTests(buildsTests)
489511
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.
490512
tests = append(tests, buildsTestsCopy...)
@@ -995,7 +1017,7 @@ func determineEnvironmentFlags(ctx context.Context, upgrade bool, dryRun bool) (
9951017
envFlagBuilder.AddTopology(&singleReplicaTopology)
9961018
}
9971019

998-
//Additional flags can only be determined if we are able to obtain the clusterState
1020+
// Additional flags can only be determined if we are able to obtain the clusterState
9991021
if clusterState != nil {
10001022
envFlagBuilder.AddAPIGroups(clusterState.APIGroups.UnsortedList()...).
10011023
AddFeatureGates(clusterState.EnabledFeatureGates.UnsortedList()...)
@@ -1008,7 +1030,7 @@ func determineEnvironmentFlags(ctx context.Context, upgrade bool, dryRun bool) (
10081030

10091031
arch := "Unknown"
10101032
if len(clusterState.Masters.Items) > 0 {
1011-
//TODO(sgoeddel): eventually, we may need to check every node and pass "multi" as the value if any of them differ from the masters
1033+
// TODO(sgoeddel): eventually, we may need to check every node and pass "multi" as the value if any of them differ from the masters
10121034
arch = clusterState.Masters.Items[0].Status.NodeInfo.Architecture
10131035
}
10141036
envFlagBuilder.AddArchitecture(arch)

0 commit comments

Comments
 (0)