Skip to content

Commit

Permalink
Fill up supervisor e2e test
Browse files Browse the repository at this point in the history
- Enable test "When testing clusterctl upgrades using ClusterClass"

Signed-off-by: Gong Zhang <gongz@vmware.com>
  • Loading branch information
zhanggbj committed Jun 26, 2024
1 parent f884467 commit a4070b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
8 changes: 4 additions & 4 deletions test/e2e/clusterctl_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (
capvReleaseMarkerPrefix = "go://sigs.k8s.io/cluster-api-provider-vsphere@v%s"
)

var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.7=>1.7) [ClusterClass]", func() {
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.7=>1.7) [supervisor] [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.10-current" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
Expand All @@ -61,7 +61,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10
InitWithBootstrapProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithControlPlaneProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithInfrastructureProviders: []string{fmt.Sprintf(providerVSpherePrefix, capvStableRelease)},
InitWithRuntimeExtensionProviders: []string{},
InitWithRuntimeExtensionProviders: testSpecificSettingsGetter().RuntimeExtensionProviders,
InitWithIPAMProviders: []string{},
// InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version.
// This is to guarantee that both, the old and new CAPI version, support the defined version.
Expand All @@ -75,7 +75,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10
}, WithIP("WORKLOAD_CONTROL_PLANE_ENDPOINT_IP"))
})

var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=>current, CAPI 1.6=>1.7) [ClusterClass]", func() {
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=>current, CAPI 1.6=>1.7) [supervisor] [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.9-current" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
Expand All @@ -99,7 +99,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=
InitWithBootstrapProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithControlPlaneProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithInfrastructureProviders: []string{fmt.Sprintf(providerVSpherePrefix, capvStableRelease)},
InitWithRuntimeExtensionProviders: []string{},
InitWithRuntimeExtensionProviders: testSpecificSettingsGetter().RuntimeExtensionProviders,
InitWithIPAMProviders: []string{},
// InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version.
// This is to guarantee that both, the old and new CAPI version, support the defined version.
Expand Down
19 changes: 15 additions & 4 deletions test/e2e/e2e_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ func WithPrefix(variableName string) SetupOption {
}

type testSettings struct {
ClusterctlConfigPath string
Variables map[string]string
PostNamespaceCreatedFunc func(managementClusterProxy framework.ClusterProxy, workloadClusterNamespace string)
FlavorForMode func(flavor string) string
ClusterctlConfigPath string
Variables map[string]string
PostNamespaceCreatedFunc func(managementClusterProxy framework.ClusterProxy, workloadClusterNamespace string)
FlavorForMode func(flavor string) string
RuntimeExtensionProviders []string
}

// Setup for the specific test.
Expand All @@ -92,6 +93,7 @@ func Setup(specName string, f func(testSpecificSettings func() testSettings), op
testSpecificIPAddressClaims vsphereip.AddressClaims
testSpecificVariables map[string]string
postNamespaceCreatedFunc func(managementClusterProxy framework.ClusterProxy, workloadClusterNamespace string)
runtimeExtensionProviders []string
)
BeforeEach(func() {
Byf("Setting up test env for %s", specName)
Expand Down Expand Up @@ -182,6 +184,14 @@ func Setup(specName string, f func(testSpecificSettings func() testSettings), op
OutputPath: testSpecificClusterctlConfigPath,
Variables: testSpecificVariables,
})

if testMode == SupervisorTestMode {
runtimeExtensionProviders = append(runtimeExtensionProviders, "vm-operator")
}

if testTarget == VCSimTestTarget {
runtimeExtensionProviders = append(runtimeExtensionProviders, "net-operator")
}
})
defer AfterEach(func() {
Byf("Cleaning up test env for %s", specName)
Expand Down Expand Up @@ -214,6 +224,7 @@ func Setup(specName string, f func(testSpecificSettings func() testSettings), op
}
return flavor
},
RuntimeExtensionProviders: runtimeExtensionProviders,
}
})
}
Expand Down

0 comments on commit a4070b8

Please sign in to comment.