-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ModuleReleaseMeta Sync test - CRUD for ModuleTemplate
- Loading branch information
Showing
5 changed files
with
127 additions
and
2 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package e2e_test | ||
|
||
import ( | ||
"github.com/kyma-project/lifecycle-manager/api/v1beta2" | ||
|
||
. "github.com/kyma-project/lifecycle-manager/pkg/testutils" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("ModuleReleaseMeta Sync", Ordered, func() { | ||
kyma := NewKymaWithSyncLabel("kyma-sample", ControlPlaneNamespace, v1beta2.DefaultChannel) | ||
module := NewTemplateOperator(v1beta2.DefaultChannel) | ||
v1Version := "1.1.1-e2e-test" | ||
InitEmptyKymaBeforeAll(kyma) | ||
|
||
Context("Given SKR Cluster with ModuleTemplate", func() { | ||
It("When Template Operator v1 ModuleTemplate is applied in the KCP Cluster with ModuleReleaseMeta", func() { | ||
By("Then the Template Operator v1 ModuleTemplate exists in the KCP Cluster") | ||
Eventually(ModuleTemplateExists). | ||
WithContext(ctx). | ||
WithArguments(kcpClient, module, v1beta2.DefaultChannel). | ||
Should(Succeed()) | ||
|
||
By("And the Template Operator v1 ModuleTemplate exists in the KCP Cluster") | ||
Eventually(ModuleTemplateExists). | ||
WithContext(ctx). | ||
WithArguments(skrClient, module, v1beta2.DefaultChannel). | ||
Should(Succeed()) | ||
|
||
By("And the ModuleReleaseMeta exists on the KCP Cluster with the correct channel-version") | ||
Eventually(ModuleReleaseMetaExists). | ||
WithContext(ctx). | ||
WithArguments(module.Name, ControlPlaneNamespace, kcpClient). | ||
Should(Succeed()) | ||
|
||
Eventually(ModuleReleaseMetaContainsCorrectChannelVersion). | ||
WithContext(ctx). | ||
WithArguments(module.Name, ControlPlaneNamespace, v1beta2.DefaultChannel, v1Version, kcpClient). | ||
Should(Succeed()) | ||
|
||
Skip("And the ModuleReleaseMeta exists on the SKR Cluster with the correct channel-version") | ||
Eventually(ModuleReleaseMetaExists). | ||
WithContext(ctx). | ||
WithArguments(module.Name, RemoteNamespace, skrClient). | ||
Should(Succeed()) | ||
|
||
Eventually(ModuleReleaseMetaContainsCorrectChannelVersion). | ||
WithContext(ctx). | ||
WithArguments(module.Name, RemoteNamespace, v1beta2.DefaultChannel, v1Version, skrClient). | ||
Should(Succeed()) | ||
}) | ||
|
||
It("When Template Operator v1 ModuleTemplate is removed from the KCP Cluster", func() { | ||
Eventually(DeleteModuleTemplate). | ||
WithContext(ctx). | ||
WithArguments(kcpClient, module, v1beta2.DefaultChannel). | ||
Should(Succeed()) | ||
|
||
By("Then Template Operator v1 ModuleTemplate no longer exists on the KCP Cluster") | ||
Eventually(ModuleTemplateExists). | ||
WithContext(ctx). | ||
WithArguments(kcpClient, module, v1beta2.DefaultChannel). | ||
Should(Equal(ErrNotFound)) | ||
|
||
By("Then Template Operator v1 ModuleTemplate no longer exists on the SKR Cluster") | ||
Eventually(ModuleTemplateExists). | ||
WithContext(ctx). | ||
WithArguments(skrClient, module, v1beta2.DefaultChannel). | ||
Should(Equal(ErrNotFound)) | ||
}) | ||
|
||
It("When Template Operator v2 ModuleTemplate is applied in the KCP Cluster", func() { | ||
By("Then the Template Operator v2 ModuleTemplate exists in the KCP Cluster") | ||
Eventually(ModuleTemplateExists). | ||
WithContext(ctx). | ||
WithArguments(kcpClient, module, v1beta2.DefaultChannel). | ||
Should(Succeed()) | ||
|
||
By("And the Template Operator v2 ModuleTemplate exists in the KCP Cluster") | ||
Eventually(ModuleTemplateExists). | ||
WithContext(ctx). | ||
WithArguments(skrClient, module, v1beta2.DefaultChannel). | ||
Should(Succeed()) | ||
}) | ||
}) | ||
}) |