Skip to content

Commit fe3d762

Browse files
authored
Merge pull request kubernetes-sigs#10060 from sbueringer/pr-add-conformance-tests
🌱 Add conformance e2e tests
2 parents 0f55580 + 6a32073 commit fe3d762

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

scripts/ci-e2e-lib.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ k8s::prepareKindestImages() {
6565
kind::prepareKindestImage "$resolveVersion"
6666
fi
6767

68+
if [ -n "${KUBERNETES_VERSION_LATEST_CI:-}" ]; then
69+
k8s::resolveVersion "KUBERNETES_VERSION_LATEST_CI" "$KUBERNETES_VERSION_LATEST_CI"
70+
export KUBERNETES_VERSION_LATEST_CI=$resolveVersion
71+
72+
kind::prepareKindestImage "$resolveVersion"
73+
fi
74+
6875
if [ -n "${BUILD_NODE_IMAGE_TAG:-}" ]; then
6976
k8s::resolveVersion "BUILD_NODE_IMAGE_TAG" "$BUILD_NODE_IMAGE_TAG"
7077
export BUILD_NODE_IMAGE_TAG=$resolveVersion

scripts/ci-e2e.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ capi:buildDockerImages
4444
# - KUBERNETES_VERSION
4545
# - KUBERNETES_VERSION_UPGRADE_TO
4646
# - KUBERNETES_VERSION_UPGRADE_FROM
47+
# - KUBERNETES_VERSION_LATEST_CI
4748
k8s::prepareKindestImages
4849

4950
# pre-pull all the images that will be used in the e2e, thus making the actual test run

test/e2e/config/docker.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ variables:
241241
KUBERNETES_VERSION: "v1.29.0"
242242
KUBERNETES_VERSION_UPGRADE_FROM: "v1.28.0"
243243
KUBERNETES_VERSION_UPGRADE_TO: "v1.29.0"
244+
KUBERNETES_VERSION_LATEST_CI: "ci/latest-1.30"
244245
ETCD_VERSION_UPGRADE_TO: "3.5.10-0"
245246
COREDNS_VERSION_UPGRADE_TO: "v1.11.1"
246247
DOCKER_SERVICE_DOMAIN: "cluster.local"

test/e2e/k8s_conformance_test.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ package e2e
2121

2222
import (
2323
. "github.com/onsi/ginkgo/v2"
24+
. "github.com/onsi/gomega"
2425
"k8s.io/utils/ptr"
26+
27+
"sigs.k8s.io/cluster-api/test/framework/kubernetesversions"
2528
)
2629

27-
var _ = Describe("When testing K8S conformance [Conformance]", func() {
30+
var _ = Describe("When testing K8S conformance [Conformance] [K8s-Install]", func() {
2831
K8SConformanceSpec(ctx, func() K8SConformanceSpecInput {
2932
return K8SConformanceSpecInput{
3033
E2EConfig: e2eConfig,
@@ -35,3 +38,23 @@ var _ = Describe("When testing K8S conformance [Conformance]", func() {
3538
InfrastructureProvider: ptr.To("docker")}
3639
})
3740
})
41+
42+
var _ = Describe("When testing K8S conformance with K8S latest ci [Conformance] [K8s-Install-ci-latest]", func() {
43+
K8SConformanceSpec(ctx, func() K8SConformanceSpecInput {
44+
kubernetesVersion, err := kubernetesversions.ResolveVersion(ctx, e2eConfig.Variables["KUBERNETES_VERSION_LATEST_CI"])
45+
Expect(err).NotTo(HaveOccurred())
46+
47+
// Kubernetes version has to be set as KUBERNETES_VERSION because the conformance test
48+
// expects it there.
49+
testSpecificE2EConfig := e2eConfig.DeepCopy()
50+
e2eConfig.Variables["KUBERNETES_VERSION"] = kubernetesVersion
51+
52+
return K8SConformanceSpecInput{
53+
E2EConfig: testSpecificE2EConfig,
54+
ClusterctlConfigPath: clusterctlConfigPath,
55+
BootstrapClusterProxy: bootstrapClusterProxy,
56+
ArtifactFolder: artifactFolder,
57+
SkipCleanup: skipCleanup,
58+
InfrastructureProvider: ptr.To("docker")}
59+
})
60+
})

0 commit comments

Comments
 (0)