Skip to content

Commit

Permalink
set num-nodes flag automatically (#16176)
Browse files Browse the repository at this point in the history
Co-authored-by: upodroid <[email protected]>
  • Loading branch information
upodroid and upodroid authored Jan 20, 2024
1 parent 32febfe commit 2cd7993
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion tests/e2e/pkg/tester/skip_regex.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
)

const (
skipRegexBase = "\\[Slow\\]|\\[Serial\\]|\\[Disruptive\\]|\\[Flaky\\]|\\[Feature:.+\\]|nfs|NFS|Gluster"
skipRegexBase = "\\[Slow\\]|\\[Serial\\]|\\[Disruptive\\]|\\[Flaky\\]|\\[Feature:.+\\]|nfs|NFS|Gluster|NodeProblemDetector"
)

func (t *Tester) setSkipRegexFlag() error {
Expand Down Expand Up @@ -81,6 +81,8 @@ func (t *Tester) setSkipRegexFlag() error {
skipRegex += "|same.hostPort.but.different.hostIP.and.protocol"
// https://github.com/cilium/cilium/issues/9207
skipRegex += "|serve.endpoints.on.same.port.and.different.protocols"
// https://github.com/kubernetes/kubernetes/blob/418ae605ec1b788d43bff7ac44af66d8b669b833/test/e2e/network/networking.go#L135
skipRegex += "|should.check.kube-proxy.urls"

if isPre28 {
// These may be fixed in Cilium 1.13 but skipping for now
Expand Down
15 changes: 10 additions & 5 deletions tests/e2e/pkg/tester/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"os"
"os/exec"
"strconv"
"strings"

"github.com/octago/sflags/gen/gpflag"
Expand Down Expand Up @@ -187,11 +188,6 @@ func (t *Tester) addNodeIG() error {
return err
}

// Skip this function for non gce clusters
if cluster.Spec.LegacyCloudProvider != "gce" {
return nil
}

igs, err := kops.GetInstanceGroups("kops", cluster.Name, nil)
if err != nil {
return err
Expand All @@ -203,6 +199,15 @@ func (t *Tester) addNodeIG() error {
ig = v
}
}
numNodes := int(*ig.Spec.MaxSize) // we assume that MinSize = Maxsize, this is true for e2e testing
klog.Infof("Setting -num-nodes=%v", numNodes)
t.TestArgs += " -num-nodes=" + strconv.Itoa(numNodes)

// Skip the rest of this function for non gce clusters
if cluster.Spec.LegacyCloudProvider != "gce" {
return nil
}

nodeTag := gce.TagForRole(cluster.ObjectMeta.Name, unversioned.InstanceGroupRoleNode)
klog.Infof("Setting --node-tag=%s", nodeTag)
t.TestArgs += " --node-tag=" + nodeTag
Expand Down

0 comments on commit 2cd7993

Please sign in to comment.