Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Kubernetes version e2e test doesn't set versions correctly #4659

Closed
nojnhuh opened this issue Apr 15, 2022 · 3 comments
Closed

Kubernetes version e2e test doesn't set versions correctly #4659

nojnhuh opened this issue Apr 15, 2022 · 3 comments
Assignees
Labels
area/CI Related to continuous integration area/e2e-tests End-to-end tests kind/bug Something isn't working size/M 7 days (~1.5 week)
Milestone

Comments

@nojnhuh
Copy link
Contributor

nojnhuh commented Apr 15, 2022

Bug description: The e2e tests for different Kubernetes versions defined in tests/e2e/e2e_k8s_version_test.go doesn't correctly set Kubernetes versions such that the tests actually run on kind clusters using those versions.

CI logs report a version matching kind's default used for both tests:

Currently, even if the -kindClusterVersion flag is passed, the framework always chooses kind's default because, based on my understanding of Ginkgo, the lines setting and resetting the cluster version are run back-to-back before the code inside the It block between them. Moving those inside the It block doesn't fix the issue because then Td.ClusterVersion is being set after the cluster is already provisioned by the framework.

Affected area (please mark with X where applicable):

  • Install [ ]
  • SMI Traffic Access Policy [ ]
  • SMI Traffic Specs Policy [ ]
  • SMI Traffic Split Policy [ ]
  • Permissive Traffic Policy [ ]
  • Ingress [ ]
  • Egress [ ]
  • Envoy Control Plane [ ]
  • CLI Tool [ ]
  • Metrics [ ]
  • Certificate Management [ ]
  • Sidecar Injection [ ]
  • Logging [ ]
  • Debugging [ ]
  • Tests [X]
  • Demo [ ]
  • CI System [ ]

Expected behavior: The specified Kubernetes versions are used for those tests.

Steps to reproduce the bug (as precisely as possible):
Roughly matching the flags used in CI:

make test-e2e CTR_REGISTRY=localhost:5000 CTR_TAG=latest E2E_FLAGS="-installType=KindCluster -ginkgo.focus='v1.22.8'"

Logs then show:

> k8s server version: v1.23.4

And docker ps shows kindest/node:v1.23.4 running.

Bug report archive:

Environment:

  • OSM version (use osm version):
CLI Version: version.Info{Version:"dev", GitCommit:"a918abff99a2106f913302db2fc8705651d2a72d", BuildDate:""}
  • Kubernetes version (use kubectl version):
  • Size of cluster (number of worker nodes in the cluster):
  • Others:
@nojnhuh nojnhuh added kind/bug Something isn't working area/CI Related to continuous integration area/e2e-tests End-to-end tests labels Apr 15, 2022
@nojnhuh nojnhuh added this to the vFuture milestone Apr 15, 2022
@shashankram
Copy link
Member

Good catch @nojnhuh. Would it make sense to override the default in the test, reset the version immediately after cluster install, and use the default version otherwise?

@nojnhuh
Copy link
Contributor Author

nojnhuh commented Apr 15, 2022

I think the root of the problem is that these tests require their own specific cluster setups but CI is configured to run each bucket of tests entirely in one cluster. The framework has a -cleanupKindClusterBetweenTests that we can maybe use to get this working, but otherwise the framework wasn't really designed to handle tests like this that are tightly coupled to specific cluster configurations.

@shashankram
Copy link
Member

I think the root of the problem is that these tests require their own specific cluster setups but CI is configured to run each bucket of tests entirely in one cluster. The framework has a -cleanupKindClusterBetweenTests that we can maybe use to get this working, but otherwise the framework wasn't really designed to handle tests like this that are tightly coupled to specific cluster configurations.

That explains the behavior. I forgot that in the CI we reuse the cluster between tests. Not sure if it's worth bucketing per version just for 3 tests. An alternative to getting coverage for at least 2 versions is to ensure the demo (maestro) and e2e run against different versions.

@trstringer trstringer modified the milestones: vFuture, v1.2 Apr 21, 2022
@trstringer trstringer moved this to Todo in OSM Roadmap (dev) Apr 21, 2022
@trstringer trstringer added the size/M 7 days (~1.5 week) label Apr 21, 2022
@nojnhuh nojnhuh self-assigned this May 24, 2022
@nojnhuh nojnhuh moved this from Todo to In Progress in OSM Roadmap (dev) May 24, 2022
Repository owner moved this from In Progress to Done in OSM Roadmap (dev) May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/CI Related to continuous integration area/e2e-tests End-to-end tests kind/bug Something isn't working size/M 7 days (~1.5 week)
Projects
Status: Done
Development

No branches or pull requests

3 participants