-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 Fix ci-latest test to actually use ci latest #10080
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:main
from
sbueringer:pr-fix-ci-latest
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ limitations under the License. | |
package e2e | ||
|
||
import ( | ||
"os" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
"k8s.io/utils/ptr" | ||
|
@@ -28,6 +30,7 @@ import ( | |
) | ||
|
||
var _ = Describe("When testing K8S conformance [Conformance] [K8s-Install]", func() { | ||
// Note: This installs a cluster based on KUBERNETES_VERSION and runs conformance tests. | ||
K8SConformanceSpec(ctx, func() K8SConformanceSpecInput { | ||
return K8SConformanceSpecInput{ | ||
E2EConfig: e2eConfig, | ||
|
@@ -40,17 +43,16 @@ var _ = Describe("When testing K8S conformance [Conformance] [K8s-Install]", fun | |
}) | ||
|
||
var _ = Describe("When testing K8S conformance with K8S latest ci [Conformance] [K8s-Install-ci-latest]", func() { | ||
// Note: This installs a cluster based on KUBERNETES_VERSION_LATEST_CI and runs conformance tests. | ||
// Note: We are resolving KUBERNETES_VERSION_LATEST_CI and then setting the resolved version as | ||
// KUBERNETES_VERSION env var. This only works without side effects on other tests because we are | ||
// running this test in its separate job. | ||
K8SConformanceSpec(ctx, func() K8SConformanceSpecInput { | ||
kubernetesVersion, err := kubernetesversions.ResolveVersion(ctx, e2eConfig.Variables["KUBERNETES_VERSION_LATEST_CI"]) | ||
kubernetesVersion, err := kubernetesversions.ResolveVersion(ctx, e2eConfig.GetVariable("KUBERNETES_VERSION_LATEST_CI")) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
// Kubernetes version has to be set as KUBERNETES_VERSION because the conformance test | ||
// expects it there. | ||
testSpecificE2EConfig := e2eConfig.DeepCopy() | ||
e2eConfig.Variables["KUBERNETES_VERSION"] = kubernetesVersion | ||
|
||
Expect(os.Setenv("KUBERNETES_VERSION", kubernetesVersion)).To(Succeed()) | ||
return K8SConformanceSpecInput{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The actual mistake that lead to us using the wrong version was setting the variable in e2eConfig instead of in testSpecificE2EConfig 😂 |
||
E2EConfig: testSpecificE2EConfig, | ||
E2EConfig: e2eConfig, | ||
ClusterctlConfigPath: clusterctlConfigPath, | ||
BootstrapClusterProxy: bootstrapClusterProxy, | ||
ArtifactFolder: artifactFolder, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically I don't have to consider env vars when doing read/write of the version as we don't set KUBERNETES_VERSION_LATEST_CI via env var (just via e2e config). But I think it's better to also support the case where the env var is set