Skip to content

Commit

Permalink
Separate auto-migration tests in a suite
Browse files Browse the repository at this point in the history
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
  • Loading branch information
Danil-Grigorev committed Jun 27, 2024
1 parent d7ecf2b commit 0de431b
Show file tree
Hide file tree
Showing 3 changed files with 451 additions and 35 deletions.
35 changes: 0 additions & 35 deletions test/e2e/suites/import-gitops/import_gitops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,6 @@ import (
"github.com/rancher/turtles/test/e2e/specs"
)

var _ = Describe("[Docker] [Kubeadm] - [management.cattle.io/v3] Migrate v1 to management v3 cluster functionality should work", Label(e2e.ShortTestLabel), func() {
BeforeEach(func() {
komega.SetClient(setupClusterResult.BootstrapClusterProxy.GetClient())
komega.SetContext(ctx)
})

specs.MigrateToV3UsingGitOpsSpec(ctx, func() specs.MigrateToV3UsingGitOpsSpecInput {
return specs.MigrateToV3UsingGitOpsSpecInput{
HelmBinaryPath: flagVals.HelmBinaryPath,
ChartPath: flagVals.ChartPath,
E2EConfig: e2eConfig,
BootstrapClusterProxy: setupClusterResult.BootstrapClusterProxy,
ClusterctlConfigPath: flagVals.ConfigPath,
ClusterctlBinaryPath: flagVals.ClusterctlBinaryPath,
ArtifactFolder: flagVals.ArtifactFolder,
ClusterTemplate: e2e.CAPIDockerKubeadm,
ClusterName: "clusterv3-migrated",
ControlPlaneMachineCount: ptr.To(1),
WorkerMachineCount: ptr.To(1),
GitAddr: giteaResult.GitAddress,
GitAuthSecretName: e2e.AuthSecretName,
SkipCleanup: false,
SkipDeletionTest: false,
LabelNamespace: true,
TestClusterReimport: true,
RancherServerURL: hostName,
CAPIClusterCreateWaitName: "wait-rancher",
DeleteClusterWaitName: "wait-controllers",
CapiClusterOwnerLabel: e2e.CapiClusterOwnerLabel,
CapiClusterOwnerNamespaceLabel: e2e.CapiClusterOwnerNamespaceLabel,
OwnedLabelName: e2e.OwnedLabelName,
}
})
})

var _ = Describe("[Docker] [Kubeadm] Create and delete CAPI cluster functionality should work with namespace auto-import", Label(e2e.ShortTestLabel), func() {
BeforeEach(func() {
SetClient(setupClusterResult.BootstrapClusterProxy.GetClient())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//go:build e2e
// +build e2e

/*
Copyright © 2023 - 2024 SUSE LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package migrate_gitops

import (
_ "embed"

. "github.com/onsi/ginkgo/v2"
"sigs.k8s.io/controller-runtime/pkg/envtest/komega"

"k8s.io/utils/ptr"

"github.com/rancher/turtles/test/e2e"
"github.com/rancher/turtles/test/e2e/specs"
)

var _ = Describe("[Docker] [Kubeadm] - [management.cattle.io/v3] Migrate v1 to management v3 cluster functionality should work", Label(e2e.ShortTestLabel), func() {
BeforeEach(func() {
komega.SetClient(setupClusterResult.BootstrapClusterProxy.GetClient())
komega.SetContext(ctx)
})

specs.MigrateToV3UsingGitOpsSpec(ctx, func() specs.MigrateToV3UsingGitOpsSpecInput {
return specs.MigrateToV3UsingGitOpsSpecInput{
HelmBinaryPath: flagVals.HelmBinaryPath,
ChartPath: flagVals.ChartPath,
E2EConfig: e2eConfig,
BootstrapClusterProxy: setupClusterResult.BootstrapClusterProxy,
ClusterctlConfigPath: flagVals.ConfigPath,
ClusterctlBinaryPath: flagVals.ClusterctlBinaryPath,
ArtifactFolder: flagVals.ArtifactFolder,
ClusterTemplate: e2e.CAPIDockerKubeadm,
ClusterName: "clusterv3-migrated",
ControlPlaneMachineCount: ptr.To(1),
WorkerMachineCount: ptr.To(1),
GitAddr: giteaResult.GitAddress,
GitAuthSecretName: e2e.AuthSecretName,
SkipCleanup: false,
SkipDeletionTest: false,
LabelNamespace: true,
TestClusterReimport: true,
RancherServerURL: hostName,
CAPIClusterCreateWaitName: "wait-rancher",
DeleteClusterWaitName: "wait-controllers",
CapiClusterOwnerLabel: e2e.CapiClusterOwnerLabel,
CapiClusterOwnerNamespaceLabel: e2e.CapiClusterOwnerNamespaceLabel,
OwnedLabelName: e2e.OwnedLabelName,
}
})
})
Loading

0 comments on commit 0de431b

Please sign in to comment.