Skip to content

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedosin committed Aug 25, 2023
1 parent b358f27 commit 51dd003
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 129 deletions.
72 changes: 36 additions & 36 deletions test/e2e/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func

It("should deploy all providers with custom namespace and versions", func() {
manifests, err := helmChart.Run(map[string]string{
"secretName": "test-secret-name",
"secretNamespace": "test-secret-namespace",
"core": "capi-custom-ns:cluster-api:v1.4.2",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.4.2",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.4.2",
"infrastructure": "capd-custom-ns:docker:v1.4.2",
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"core": "capi-custom-ns:cluster-api:v1.4.2",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.4.2",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.4.2",
"infrastructure": "capd-custom-ns:docker:v1.4.2",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -69,12 +69,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func

It("should deploy all providers with custom versions", func() {
manifests, err := helmChart.Run(map[string]string{
"secretName": "test-secret-name",
"secretNamespace": "test-secret-namespace",
"core": "cluster-api:v1.4.2",
"controlPlane": "kubeadm:v1.4.2",
"bootstrap": "kubeadm:v1.4.2",
"infrastructure": "docker:v1.4.2",
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"core": "cluster-api:v1.4.2",
"controlPlane": "kubeadm:v1.4.2",
"bootstrap": "kubeadm:v1.4.2",
"infrastructure": "docker:v1.4.2",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -85,12 +85,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func

It("should deploy all providers with latest version", func() {
manifests, err := helmChart.Run(map[string]string{
"secretName": "test-secret-name",
"secretNamespace": "test-secret-namespace",
"core": "cluster-api",
"controlPlane": "kubeadm",
"bootstrap": "kubeadm",
"infrastructure": "docker",
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"core": "cluster-api",
"controlPlane": "kubeadm",
"bootstrap": "kubeadm",
"infrastructure": "docker",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -101,9 +101,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func

It("should deploy core, bootstrap, control plane when only infra is specified", func() {
manifests, err := helmChart.Run(map[string]string{
"secretName": "test-secret-name",
"secretNamespace": "test-secret-namespace",
"infrastructure": "docker",
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"infrastructure": "docker",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -114,9 +114,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func

It("should deploy core when only bootstrap is specified", func() {
manifests, err := helmChart.Run(map[string]string{
"secretName": "test-secret-name",
"secretNamespace": "test-secret-namespace",
"bootstrap": "kubeadm",
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"bootstrap": "kubeadm",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -127,9 +127,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func

It("should deploy core when only control plane is specified", func() {
manifests, err := helmChart.Run(map[string]string{
"secretName": "test-secret-name",
"secretNamespace": "test-secret-namespace",
"controlPlane": "kubeadm",
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"controlPlane": "kubeadm",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -140,9 +140,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func

It("should deploy multiple infra providers with custom namespace and versions", func() {
manifests, err := helmChart.Run(map[string]string{
"secretName": "test-secret-name",
"secretNamespace": "test-secret-namespace",
"infrastructure": "capd-custom-ns:docker:v1.4.2;capz-custom-ns:azure:v1.10.0",
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"infrastructure": "capd-custom-ns:docker:v1.4.2;capz-custom-ns:azure:v1.10.0",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -153,9 +153,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func

It("should deploy multiple control plane providers with custom namespace and versions", func() {
manifests, err := helmChart.Run(map[string]string{
"secretName": "test-secret-name",
"secretNamespace": "test-secret-namespace",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.4.2;rke2-control-plane-custom-ns:rke2:v0.3.0",
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.4.2;rke2-control-plane-custom-ns:rke2:v0.3.0",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -166,9 +166,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func

It("should deploy multiple bootstrap providers with custom namespace and versions", func() {
manifests, err := helmChart.Run(map[string]string{
"secretName": "test-secret-name",
"secretNamespace": "test-secret-namespace",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.4.2;rke2-bootstrap-custom-ns:rke2:v0.3.0",
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.4.2;rke2-bootstrap-custom-ns:rke2:v0.3.0",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand Down
28 changes: 16 additions & 12 deletions test/e2e/resources/all-providers-custom-ns-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ metadata:
name: capd-custom-ns
---
# Source: cluster-api-operator/templates/bootstrap.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: BootstrapProvider
metadata:
name: kubeadm
Expand All @@ -46,11 +46,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/control-plane.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: ControlPlaneProvider
metadata:
name: kubeadm
Expand All @@ -60,11 +61,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/core.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
name: cluster-api
Expand All @@ -74,11 +76,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/infra.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: InfrastructureProvider
metadata:
name: docker
Expand All @@ -88,5 +91,6 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
28 changes: 16 additions & 12 deletions test/e2e/resources/all-providers-custom-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ metadata:
name: docker-infrastructure-system
---
# Source: cluster-api-operator/templates/bootstrap.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: BootstrapProvider
metadata:
name: kubeadm
Expand All @@ -46,11 +46,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/control-plane.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: ControlPlaneProvider
metadata:
name: kubeadm
Expand All @@ -60,11 +61,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/core.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
name: cluster-api
Expand All @@ -74,11 +76,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/infra.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: InfrastructureProvider
metadata:
name: docker
Expand All @@ -88,5 +91,6 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
28 changes: 16 additions & 12 deletions test/e2e/resources/all-providers-latest-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ metadata:
name: docker-infrastructure-system
---
# Source: cluster-api-operator/templates/bootstrap.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: BootstrapProvider
metadata:
name: kubeadm
Expand All @@ -45,11 +45,12 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/control-plane.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: ControlPlaneProvider
metadata:
name: kubeadm
Expand All @@ -58,11 +59,12 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/core.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
name: cluster-api
Expand All @@ -71,11 +73,12 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/infra.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: InfrastructureProvider
metadata:
name: docker
Expand All @@ -84,5 +87,6 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
21 changes: 12 additions & 9 deletions test/e2e/resources/multiple-bootstrap-custom-ns-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ metadata:
name: rke2-bootstrap-custom-ns
---
# Source: cluster-api-operator/templates/bootstrap.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: BootstrapProvider
metadata:
name: kubeadm
Expand All @@ -37,11 +37,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/bootstrap.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: BootstrapProvider
metadata:
name: rke2
Expand All @@ -51,11 +52,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: v0.3.0
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
---
# Source: cluster-api-operator/templates/bootstrap-conditions.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha1
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
name: cluster-api
Expand All @@ -64,5 +66,6 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
secretName: test-secret-name
secretNamespace: test-secret-namespace
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Loading

0 comments on commit 51dd003

Please sign in to comment.