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

Trim e2e skip regexes for Cilium #15753

Merged
merged 1 commit into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions tests/e2e/pkg/kops/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,20 @@ func GetInstanceGroups(kopsBinary, clusterName string, env []string) ([]*api.Ins
}
return igs, nil
}

// GetVersion will retrieve the kOps version.
func GetVersion(kopsBinary string) (string, error) {
args := []string{
kopsBinary, "version", "--short",
}
c := exec.Command(args[0], args[1:]...)
var stdout bytes.Buffer
c.SetStdout(&stdout)
var stderr bytes.Buffer
c.SetStderr(&stderr)
if err := c.Run(); err != nil {
klog.Warningf("failed to run %s; stderr=%s", strings.Join(args, " "), stderr.String())
return "", fmt.Errorf("error querying version from %s: %w", strings.Join(args, " "), err)
}
return stdout.String(), nil
}
35 changes: 23 additions & 12 deletions tests/e2e/pkg/tester/skip_regex.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ func (t *Tester) setSkipRegexFlag() error {
return nil
}

kopsVersion, err := t.getKopsVersion()
if err != nil {
return err
}
isPre28 := kopsVersion < "1.28"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This will evaluate to false for any future 1.28 pre-release builds

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we can't inspect the Cluster manifest because spec.networking.cilium.version isn't guaranteed to be set. I suppose one alternative would be to inspect the daemonset itself with the kubectl binary that the tester downloads:

func KubectlPath() string {
return artifacts.RunDir() + "/kubectl"
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evaluating false for future 1.28 pre release builds is desired behavior


cluster, err := t.getKopsCluster()
if err != nil {
return err
Expand All @@ -45,12 +51,14 @@ func (t *Tester) setSkipRegexFlag() error {

skipRegex := skipRegexBase

// All the loadbalancer tests in the suite fail on IPv6, however,
// they were skipped because they were tagged as [Slow]
// skip these tests temporary since they fail always on IPv6
// TODO: aojea
// https://github.com/kubernetes/kubernetes/issues/113964
skipRegex += "|LoadBalancers.should.be.able.to.preserve.UDP.traffic"
if isPre28 {
// All the loadbalancer tests in the suite fail on IPv6, however,
// they were skipped because they were tagged as [Slow]
// skip these tests temporary since they fail always on IPv6
// TODO: aojea
// https://github.com/kubernetes/kubernetes/issues/113964
skipRegex += "|LoadBalancers.should.be.able.to.preserve.UDP.traffic"
}

networking := cluster.Spec.LegacyNetworking
switch {
Expand All @@ -67,12 +75,15 @@ 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"
// These may be fixed in Cilium 1.13 but skipping for now
skipRegex += "|Service.with.multiple.ports.specified.in.multiple.EndpointSlices"
skipRegex += "|should.create.a.Pod.with.SCTP.HostPort"
// https://github.com/cilium/cilium/issues/18241
skipRegex += "|Services.should.create.endpoints.for.unready.pods"
skipRegex += "|Services.should.be.able.to.connect.to.terminating.and.unready.endpoints.if.PublishNotReadyAddresses.is.true"

if isPre28 {
// These may be fixed in Cilium 1.13 but skipping for now
skipRegex += "|Service.with.multiple.ports.specified.in.multiple.EndpointSlices"
skipRegex += "|should.create.a.Pod.with.SCTP.HostPort"
// https://github.com/cilium/cilium/issues/18241
skipRegex += "|Services.should.create.endpoints.for.unready.pods"
skipRegex += "|Services.should.be.able.to.connect.to.terminating.and.unready.endpoints.if.PublishNotReadyAddresses.is.true"
}
} else if networking.KubeRouter != nil {
skipRegex += "|load-balancer|hairpin|affinity\\stimeout|service\\.kubernetes\\.io|CLOSE_WAIT"
skipRegex += "|EndpointSlice.should.support.a.Service.with.multiple"
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/pkg/tester/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ func hasFlag(args string, flag string) bool {
return false
}

func (t *Tester) getKopsVersion() (string, error) {
return kops.GetVersion("kops")
}

func (t *Tester) getKopsCluster() (*api.Cluster, error) {
if t.kopsCluster != nil {
return t.kopsCluster, nil
Expand Down
Loading