Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 test/conformance: add variables to overwrite parralelization of kubetest runs #9667

Merged
merged 1 commit into from
Nov 3, 2023
Merged
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
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
Loading