-
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 test case for old moduletemplate name with modulereleasemeta
- Loading branch information
Showing
5 changed files
with
86 additions
and
1 deletion.
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
50 changes: 50 additions & 0 deletions
50
tests/e2e/modulereleasemeta_with_old_moduletemplate_name_test.go
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,50 @@ | ||
package e2e_test | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/kyma-project/lifecycle-manager/api/shared" | ||
"github.com/kyma-project/lifecycle-manager/api/v1beta2" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
|
||
. "github.com/kyma-project/lifecycle-manager/pkg/testutils" | ||
) | ||
|
||
var _ = Describe("ModuleReleaseMeta With Old ModuleTemplate Name", Ordered, func() { | ||
kyma := NewKymaWithSyncLabel("kyma-sample", ControlPlaneNamespace, v1beta2.DefaultChannel) | ||
module := NewTemplateOperator(v1beta2.DefaultChannel) | ||
|
||
expectedErrorMessage := fmt.Sprintf("failed to get module template: ModuleTemplate.operator.kyma-project.io %s-%s not found", | ||
module.Name, "1.0.0") | ||
|
||
InitEmptyKymaBeforeAll(kyma) | ||
CleanupKymaAfterAll(kyma) | ||
|
||
Context("Given kyma deployed in KCP", func() { | ||
It("When enabling Template Operator", func() { | ||
Eventually(EnableModule). | ||
WithContext(ctx). | ||
WithArguments(skrClient, defaultRemoteKymaName, RemoteNamespace, module). | ||
Should(Succeed()) | ||
}) | ||
|
||
It("Then KCP Kyma CR is in \"Error\" State", func() { | ||
Eventually(KymaIsInState). | ||
WithContext(ctx). | ||
WithArguments(kyma.GetName(), kyma.GetNamespace(), kcpClient, shared.StateError). | ||
Should(Succeed()) | ||
Consistently(KymaIsInState). | ||
WithContext(ctx). | ||
WithArguments(kyma.GetName(), kyma.GetNamespace(), kcpClient, shared.StateError). | ||
Should(Succeed()) | ||
|
||
By("And Module Message in Kyma Status is as expected") | ||
Eventually(ModuleMessageInKymaStatusIsCorrect). | ||
WithContext(ctx). | ||
WithArguments(kcpClient, kyma.GetName(), kyma.GetNamespace(), module.Name, expectedErrorMessage). | ||
Should(Succeed()) | ||
}) | ||
}) | ||
}) |