Skip to content

Commit

Permalink
Merge pull request #9667 from chrischdi/pr-conformance-serial
Browse files Browse the repository at this point in the history
🌱 test/conformance: add variables to overwrite parralelization of kubetest runs
  • Loading branch information
k8s-ci-robot authored Nov 3, 2023
2 parents 12c2572 + d8fa9f7 commit f44c0eb
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions test/e2e/k8s_conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"os"
"path/filepath"
"strconv"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -56,6 +57,8 @@ type K8SConformanceSpecInput struct {
func K8SConformanceSpec(ctx context.Context, inputGetter func() K8SConformanceSpecInput) {
const (
kubetestConfigurationVariable = "KUBETEST_CONFIGURATION"
kubetestNumberOfNodesVariable = "KUBETEST_NUMBER_OF_NODES"
kubetestGinkgoNodesVariable = "KUBETEST_GINKGO_NODES"
)
var (
specName = "k8s-conformance"
Expand Down Expand Up @@ -118,15 +121,29 @@ func K8SConformanceSpec(ctx context.Context, inputGetter func() K8SConformanceSp

workloadProxy := input.BootstrapClusterProxy.GetWorkloadCluster(ctx, namespace.Name, clusterResources.Cluster.Name)

var err error

numberOfNodes := int(workerMachineCount)
if s, ok := os.LookupEnv(kubetestNumberOfNodesVariable); ok && s != "" {
numberOfNodes, err = strconv.Atoi(s)
Expect(err).ToNot(HaveOccurred(), "Failed to parse kubetestNumberOfNodesVariable to int")
}

ginkgoNodes := int(workerMachineCount)
if s, ok := os.LookupEnv(kubetestGinkgoNodesVariable); ok && s != "" {
ginkgoNodes, err = strconv.Atoi(s)
Expect(err).ToNot(HaveOccurred(), "Failed to parse kubetestGinkgoNodesVariable to int")
}

// Start running conformance test suites.
err := kubetest.Run(
err = kubetest.Run(
ctx,
kubetest.RunInput{
ClusterProxy: workloadProxy,
NumberOfNodes: int(workerMachineCount),
NumberOfNodes: numberOfNodes,
ArtifactsDirectory: input.ArtifactFolder,
ConfigFilePath: kubetestConfigFilePath,
GinkgoNodes: int(workerMachineCount),
GinkgoNodes: ginkgoNodes,
},
)
Expect(err).ToNot(HaveOccurred(), "Failed to run Kubernetes conformance")
Expand Down

0 comments on commit f44c0eb

Please sign in to comment.