diff --git a/tests/build/build.go b/tests/build/build.go index 0d781ecd7..fac26e35f 100644 --- a/tests/build/build.go +++ b/tests/build/build.go @@ -31,6 +31,7 @@ import ( buildservice "github.com/redhat-appstudio/build-service/api/v1alpha1" "github.com/redhat-appstudio/build-service/controllers" "github.com/redhat-appstudio/e2e-tests/pkg/framework" + releasecommon "github.com/redhat-appstudio/e2e-tests/tests/release" imagecontollers "github.com/redhat-appstudio/image-controller/controllers" v1 "k8s.io/api/core/v1" ) @@ -1477,8 +1478,8 @@ var _ = framework.BuildSuiteDescribe("Build service E2E tests", Label("build", " _, err = f.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission("demo", managedNamespace, "", f.UserNamespace, "demo", constants.DefaultPipelineServiceAccount, []string{applicationName}, false, &tektonutils.PipelineRef{ Resolver: "git", Params: []tektonutils.Param{ - {Name: "url", Value: "https://github.com/redhat-appstudio/release-service-catalog"}, - {Name: "revision", Value: "main"}, + {Name: "url", Value: releasecommon.RelSvcCatalogURL}, + {Name: "revision", Value: releasecommon.RelSvcCatalogRevision}, {Name: "pathInRepo", Value: "pipelines/e2e/e2e.yaml"}, }}, &runtime.RawExtension{Raw: rawData}) Expect(err).NotTo(HaveOccurred()) diff --git a/tests/release/pipelines/push_to_external_registry.go b/tests/release/pipelines/push_to_external_registry.go index d644a1600..067347ff4 100644 --- a/tests/release/pipelines/push_to_external_registry.go +++ b/tests/release/pipelines/push_to_external_registry.go @@ -84,7 +84,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("Push to external registry", Lab "mapping": map[string]interface{}{ "components": []map[string]interface{}{ { - "name": component.GetName(), + "name": component.GetName(), "repository": releasecommon.ReleasedImagePushRepo, }, }, @@ -168,15 +168,15 @@ var _ = framework.ReleasePipelinesSuiteDescribe("Push to external registry", Lab }) It("tests if the image was pushed to quay", func() { - //retrieve the component to get the latest data + //retrieve the component to get the latest data component, err := fw.AsKubeAdmin.HasController.GetComponent(component.GetName(), devNamespace) Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("could not get component %s in the %s namespace", component.GetName(), devNamespace)) containerImageDigest := strings.Split(component.Spec.ContainerImage, "@")[1] imageDigest, err := releasecommon.GetDigestWithTagInQuay(releasecommon.ReleasedImagePushRepo + ":latest") - Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("failed while getting Digest for quay image %s with error: %+v", releasecommon.ReleasedImagePushRepo + ":latest", err)) + Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("failed while getting Digest for quay image %s with error: %+v", releasecommon.ReleasedImagePushRepo+":latest", err)) Expect(imageDigest).To(Equal(containerImageDigest)) - }) + }) It("verifies that a Release is marked as succeeded.", func() { Eventually(func() error { diff --git a/tests/release/pipelines/rh_push_to_external_registry.go b/tests/release/pipelines/rh_push_to_external_registry.go index 92ef0d5c2..98912fd7a 100644 --- a/tests/release/pipelines/rh_push_to_external_registry.go +++ b/tests/release/pipelines/rh_push_to_external_registry.go @@ -19,7 +19,7 @@ import ( "github.com/redhat-appstudio/e2e-tests/pkg/utils" "github.com/redhat-appstudio/e2e-tests/pkg/utils/contract" "github.com/redhat-appstudio/e2e-tests/pkg/utils/tekton" - releaseConst "github.com/redhat-appstudio/e2e-tests/tests/release" + releasecommon "github.com/redhat-appstudio/e2e-tests/tests/release" releaseApi "github.com/redhat-appstudio/release-service/api/v1alpha1" tektonutils "github.com/redhat-appstudio/release-service/tekton/utils" pipeline "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" @@ -69,11 +69,11 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu Expect(certPyxisStage).ToNot(BeEmpty()) // Create secret for the release registry repo "hacbs-release-tests". - _, err = fw.AsKubeAdmin.CommonController.CreateRegistryAuthSecret(releaseConst.RedhatAppstudioUserSecret, managedNamespace, sourceAuthJson) + _, err = fw.AsKubeAdmin.CommonController.CreateRegistryAuthSecret(releasecommon.RedhatAppstudioUserSecret, managedNamespace, sourceAuthJson) Expect(err).ToNot(HaveOccurred()) // Linking the build secret to the pipeline service account in dev namespace. - err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(devNamespace, releaseConst.HacbsReleaseTestsTokenSecret, constants.DefaultPipelineServiceAccount, true) + err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(devNamespace, releasecommon.HacbsReleaseTestsTokenSecret, constants.DefaultPipelineServiceAccount, true) Expect(err).ToNot(HaveOccurred()) publicKey, err := fw.AsKubeAdmin.TektonController.GetTektonChainsPublicKey() @@ -102,13 +102,13 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu Expect(err).ToNot(HaveOccurred()) Expect(fw.AsKubeAdmin.TektonController.CreateOrUpdateSigningSecret( - publicKey, releaseConst.PublicSecretNameAuth, managedNamespace)).To(Succeed()) + publicKey, releasecommon.PublicSecretNameAuth, managedNamespace)).To(Succeed()) defaultECP, err := fw.AsKubeAdmin.TektonController.GetEnterpriseContractPolicy("default", "enterprise-contract-service") Expect(err).NotTo(HaveOccurred()) policy := contract.PolicySpecWithSourceConfig(defaultECP.Spec, ecp.SourceConfig{Include: []string{"@minimal"}, Exclude: []string{"cve"}}) - managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releaseConst.ReleasePipelineServiceAccountDefault, managedNamespace, releaseConst.ManagednamespaceSecret, nil) + managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releasecommon.ReleasePipelineServiceAccountDefault, managedNamespace, releasecommon.ManagednamespaceSecret, nil) Expect(err).NotTo(HaveOccurred()) _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(devNamespace, managedServiceAccount) @@ -116,11 +116,11 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(managedNamespace, managedServiceAccount) Expect(err).NotTo(HaveOccurred()) - err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(managedNamespace, releaseConst.RedhatAppstudioUserSecret, releaseConst.ReleasePipelineServiceAccountDefault, true) + err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(managedNamespace, releasecommon.RedhatAppstudioUserSecret, releasecommon.ReleasePipelineServiceAccountDefault, true) Expect(err).ToNot(HaveOccurred()) // using cdq since git ref is not known - cdq, err := fw.AsKubeAdmin.HasController.CreateComponentDetectionQuery(releaseConst.ComponentName, devNamespace, releaseConst.GitSourceComponentUrl, "", "", "", false) + cdq, err := fw.AsKubeAdmin.HasController.CreateComponentDetectionQuery(releasecommon.ComponentName, devNamespace, releasecommon.GitSourceComponentUrl, "", "", "", false) Expect(err).NotTo(HaveOccurred()) Expect(cdq.Status.ComponentDetected).To(HaveLen(1), "Expected length of the detected Components was not 1") @@ -130,8 +130,8 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu } // using cdq since git ref is not known - additionalCompName = releaseConst.AdditionalComponentName - cdq, err = fw.AsKubeAdmin.HasController.CreateComponentDetectionQuery(additionalCompName, devNamespace, releaseConst.AdditionalGitSourceComponentUrl, "", "", "", false) + additionalCompName = releasecommon.AdditionalComponentName + cdq, err = fw.AsKubeAdmin.HasController.CreateComponentDetectionQuery(additionalCompName, devNamespace, releasecommon.AdditionalGitSourceComponentUrl, "", "", "", false) Expect(err).NotTo(HaveOccurred()) Expect(cdq.Status.ComponentDetected).To(HaveLen(1), "Expected length of the detected Components was not 1") @@ -140,7 +140,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu additionalComponentDetected = compDetected } - _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlan(releaseConst.SourceReleasePlanName, devNamespace, releaseConst.ApplicationNameDefault, managedNamespace, "true") + _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlan(releasecommon.SourceReleasePlanName, devNamespace, releasecommon.ApplicationNameDefault, managedNamespace, "true") Expect(err).NotTo(HaveOccurred()) data, err := json.Marshal(map[string]interface{}{ @@ -163,11 +163,11 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu }) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releaseConst.TargetReleasePlanAdmissionName, managedNamespace, "", devNamespace, releaseConst.ReleaseStrategyPolicyDefault, releaseConst.ReleasePipelineServiceAccountDefault, []string{releaseConst.ApplicationNameDefault}, true, &tektonutils.PipelineRef{ + _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, "", devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{ Resolver: "git", Params: []tektonutils.Param{ - {Name: "url", Value: releaseConst.RelSvcCatalogURL}, - {Name: "revision", Value: releaseConst.RelSvcCatalogRevision}, + {Name: "url", Value: releasecommon.RelSvcCatalogURL}, + {Name: "revision", Value: releasecommon.RelSvcCatalogRevision}, {Name: "pathInRepo", Value: "pipelines/rh-push-to-external-registry/rh-push-to-external-registry.yaml"}, }, }, &runtime.RawExtension{ @@ -175,10 +175,10 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu }) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.TektonController.CreateEnterpriseContractPolicy(releaseConst.ReleaseStrategyPolicyDefault, managedNamespace, policy) + _, err = fw.AsKubeAdmin.TektonController.CreateEnterpriseContractPolicy(releasecommon.ReleaseStrategyPolicyDefault, managedNamespace, policy) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.TektonController.CreatePVCInAccessMode(releaseConst.ReleasePvcName, managedNamespace, corev1.ReadWriteOnce) + _, err = fw.AsKubeAdmin.TektonController.CreatePVCInAccessMode(releasecommon.ReleasePvcName, managedNamespace, corev1.ReadWriteOnce) Expect(err).NotTo(HaveOccurred()) _, err = fw.AsKubeAdmin.CommonController.CreateRole("role-release-service-account", managedNamespace, map[string][]string{ @@ -188,10 +188,10 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu }) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.CommonController.CreateRoleBinding("role-release-service-account-binding", managedNamespace, "ServiceAccount", releaseConst.ReleasePipelineServiceAccountDefault, managedNamespace, "Role", "role-release-service-account", "rbac.authorization.k8s.io") + _, err = fw.AsKubeAdmin.CommonController.CreateRoleBinding("role-release-service-account-binding", managedNamespace, "ServiceAccount", releasecommon.ReleasePipelineServiceAccountDefault, managedNamespace, "Role", "role-release-service-account", "rbac.authorization.k8s.io") Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.HasController.CreateApplication(releaseConst.ApplicationNameDefault, devNamespace) + _, err = fw.AsKubeAdmin.HasController.CreateApplication(releasecommon.ApplicationNameDefault, devNamespace) Expect(err).NotTo(HaveOccurred()) }) @@ -209,14 +209,14 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu var _ = Describe("Post-release verification", func() { It("verifies that Component 1 can be created and build PipelineRun is created for it in dev namespace and succeeds", func() { - component1, err = fw.AsKubeAdmin.HasController.CreateComponent(componentDetected.ComponentStub, devNamespace, "", "", releaseConst.ApplicationNameDefault, true, map[string]string{}) + component1, err = fw.AsKubeAdmin.HasController.CreateComponent(componentDetected.ComponentStub, devNamespace, "", "", releasecommon.ApplicationNameDefault, true, map[string]string{}) Expect(err).NotTo(HaveOccurred()) Expect(fw.AsKubeAdmin.HasController.WaitForComponentPipelineToBeFinished(component1, "", fw.AsKubeAdmin.TektonController, &has.RetryOptions{Retries: 2, Always: true})).To(Succeed()) }) It("verifies that Component 2 can be created and build PipelineRun is created for it in dev namespace and succeeds", func() { - component2, err = fw.AsKubeAdmin.HasController.CreateComponent(additionalComponentDetected.ComponentStub, devNamespace, "", "", releaseConst.ApplicationNameDefault, true, map[string]string{}) + component2, err = fw.AsKubeAdmin.HasController.CreateComponent(additionalComponentDetected.ComponentStub, devNamespace, "", "", releasecommon.ApplicationNameDefault, true, map[string]string{}) Expect(err).NotTo(HaveOccurred()) Expect(fw.AsKubeAdmin.HasController.WaitForComponentPipelineToBeFinished(component2, "", fw.AsKubeAdmin.TektonController, &has.RetryOptions{Retries: 2, Always: true})).To(Succeed()) @@ -235,7 +235,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu return err } return nil - }, 5*time.Minute, releaseConst.DefaultInterval).Should(Succeed(), "timed out waiting for Snapshots to be created in %s namespace", devNamespace) + }, 5*time.Minute, releasecommon.DefaultInterval).Should(Succeed(), "timed out waiting for Snapshots to be created in %s namespace", devNamespace) }) It("tests that associated Release CR is created for each Component's Snapshot", func() { @@ -251,7 +251,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu return err } return nil - }, releaseConst.ReleaseCreationTimeout, releaseConst.DefaultInterval).Should(Succeed(), "timed out waiting for Release CRs to be created in %s namespace", devNamespace) + }, releasecommon.ReleaseCreationTimeout, releasecommon.DefaultInterval).Should(Succeed(), "timed out waiting for Release CRs to be created in %s namespace", devNamespace) }) It("verifies that Release PipelineRun is triggered for each Release CR", func() { @@ -277,7 +277,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu return fmt.Errorf(errMsg) } return nil - }, releaseConst.ReleasePipelineRunCreationTimeout, constants.PipelineRunPollingInterval).Should(Succeed(), fmt.Sprintf("timed out waiting for a PipelineRun to start for each Release CR in %s namespace", managedNamespace)) + }, releasecommon.ReleasePipelineRunCreationTimeout, constants.PipelineRunPollingInterval).Should(Succeed(), fmt.Sprintf("timed out waiting for a PipelineRun to start for each Release CR in %s namespace", managedNamespace)) }) It("verifies a release PipelineRun for each component succeeded in managed namespace", func() { @@ -299,7 +299,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu return fmt.Errorf(errMsg) } return nil - }, releaseConst.ReleasePipelineRunCompletionTimeout, constants.PipelineRunPollingInterval).Should(Succeed()) + }, releasecommon.ReleasePipelineRunCompletionTimeout, constants.PipelineRunPollingInterval).Should(Succeed()) }) It("validate the result of task create-pyxis-image contains image ids", func() { @@ -332,7 +332,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu } return imageIDs - }, avgControllerQueryTimeout, releaseConst.DefaultInterval).Should(HaveLen(2)) + }, avgControllerQueryTimeout, releasecommon.DefaultInterval).Should(HaveLen(2)) }) It("tests that associated Release CR has completed for each Component's Snapshot", func() { @@ -349,13 +349,13 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu return fmt.Errorf(errMsg) } return nil - }, releaseConst.ReleaseCreationTimeout, releaseConst.DefaultInterval).Should(Succeed(), "timed out waiting for Release CRs to be created in %s namespace", devNamespace) + }, releasecommon.ReleaseCreationTimeout, releasecommon.DefaultInterval).Should(Succeed(), "timed out waiting for Release CRs to be created in %s namespace", devNamespace) }) It("validates that imageIds from task create-pyxis-image exist in Pyxis.", func() { for _, imageID := range imageIDs { Eventually(func() error { - body, err := fw.AsKubeAdmin.ReleaseController.GetPyxisImageByImageID(releaseConst.PyxisStageImagesApiEndpoint, imageID, + body, err := fw.AsKubeAdmin.ReleaseController.GetPyxisImageByImageID(releasecommon.PyxisStageImagesApiEndpoint, imageID, []byte(pyxisCertDecoded), []byte(pyxisKeyDecoded)) Expect(err).NotTo(HaveOccurred(), "failed to get response body") @@ -367,7 +367,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu } return nil - }, releaseConst.ReleaseCreationTimeout, releaseConst.DefaultInterval).Should(Succeed()) + }, releasecommon.ReleaseCreationTimeout, releasecommon.DefaultInterval).Should(Succeed()) } }) }) diff --git a/tests/release/service/happy_path.go b/tests/release/service/happy_path.go index bc7ea2ee5..f38e1084e 100644 --- a/tests/release/service/happy_path.go +++ b/tests/release/service/happy_path.go @@ -17,7 +17,7 @@ import ( "github.com/redhat-appstudio/e2e-tests/pkg/utils" "github.com/redhat-appstudio/e2e-tests/pkg/utils/contract" "github.com/redhat-appstudio/e2e-tests/pkg/utils/tekton" - releaseConst "github.com/redhat-appstudio/e2e-tests/tests/release" + releasecommon "github.com/redhat-appstudio/e2e-tests/tests/release" releaseApi "github.com/redhat-appstudio/release-service/api/v1alpha1" corev1 "k8s.io/api/core/v1" ) @@ -48,7 +48,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe sourceAuthJson := utils.GetEnv("QUAY_TOKEN", "") Expect(sourceAuthJson).ToNot(BeEmpty()) - managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releaseConst.ReleasePipelineServiceAccountDefault, managedNamespace, releaseConst.ManagednamespaceSecret, nil) + managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releasecommon.ReleasePipelineServiceAccountDefault, managedNamespace, releasecommon.ManagednamespaceSecret, nil) Expect(err).NotTo(HaveOccurred()) _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(devNamespace, managedServiceAccount) @@ -56,19 +56,19 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(managedNamespace, managedServiceAccount) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.CommonController.CreateRegistryAuthSecret(releaseConst.RedhatAppstudioUserSecret, managedNamespace, sourceAuthJson) + _, err = fw.AsKubeAdmin.CommonController.CreateRegistryAuthSecret(releasecommon.RedhatAppstudioUserSecret, managedNamespace, sourceAuthJson) Expect(err).ToNot(HaveOccurred()) - err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(devNamespace, releaseConst.HacbsReleaseTestsTokenSecret, constants.DefaultPipelineServiceAccount, true) + err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(devNamespace, releasecommon.HacbsReleaseTestsTokenSecret, constants.DefaultPipelineServiceAccount, true) Expect(err).ToNot(HaveOccurred()) - err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(managedNamespace, releaseConst.RedhatAppstudioUserSecret, constants.DefaultPipelineServiceAccount, true) + err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(managedNamespace, releasecommon.RedhatAppstudioUserSecret, constants.DefaultPipelineServiceAccount, true) Expect(err).ToNot(HaveOccurred()) publicKey, err := fw.AsKubeAdmin.TektonController.GetTektonChainsPublicKey() Expect(err).ToNot(HaveOccurred()) Expect(fw.AsKubeAdmin.TektonController.CreateOrUpdateSigningSecret( - publicKey, releaseConst.PublicSecretNameAuth, managedNamespace)).To(Succeed()) + publicKey, releasecommon.PublicSecretNameAuth, managedNamespace)).To(Succeed()) defaultECP, err := fw.AsKubeAdmin.TektonController.GetEnterpriseContractPolicy("default", "enterprise-contract-service") Expect(err).NotTo(HaveOccurred()) @@ -76,7 +76,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe // using cdq since git ref is not known var componentDetected appservice.ComponentDetectionDescription - cdq, err := fw.AsKubeAdmin.HasController.CreateComponentDetectionQuery(releaseConst.ComponentName, devNamespace, releaseConst.GitSourceComponentUrl, "", "", "", false) + cdq, err := fw.AsKubeAdmin.HasController.CreateComponentDetectionQuery(releasecommon.ComponentName, devNamespace, releasecommon.GitSourceComponentUrl, "", "", "", false) Expect(err).NotTo(HaveOccurred()) Expect(cdq.Status.ComponentDetected).To(HaveLen(1), "Expected length of the detected Components was not 1") @@ -85,13 +85,13 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe componentDetected = compDetected } - _, err = fw.AsKubeAdmin.HasController.CreateApplication(releaseConst.ApplicationNameDefault, devNamespace) + _, err = fw.AsKubeAdmin.HasController.CreateApplication(releasecommon.ApplicationNameDefault, devNamespace) Expect(err).NotTo(HaveOccurred()) - component, err = fw.AsKubeAdmin.HasController.CreateComponent(componentDetected.ComponentStub, devNamespace, "", "", releaseConst.ApplicationNameDefault, false, map[string]string{}) + component, err = fw.AsKubeAdmin.HasController.CreateComponent(componentDetected.ComponentStub, devNamespace, "", "", releasecommon.ApplicationNameDefault, false, map[string]string{}) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlan(releaseConst.SourceReleasePlanName, devNamespace, releaseConst.ApplicationNameDefault, managedNamespace, "") + _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlan(releasecommon.SourceReleasePlanName, devNamespace, releasecommon.ApplicationNameDefault, managedNamespace, "") Expect(err).NotTo(HaveOccurred()) data, err := json.Marshal(map[string]interface{}{ @@ -106,11 +106,11 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe }) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releaseConst.TargetReleasePlanAdmissionName, managedNamespace, "", devNamespace, releaseConst.ReleaseStrategyPolicyDefault, releaseConst.ReleasePipelineServiceAccountDefault, []string{releaseConst.ApplicationNameDefault}, true, &tektonutils.PipelineRef{ + _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, "", devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{ Resolver: "git", Params: []tektonutils.Param{ - {Name: "url", Value: "https://github.com/redhat-appstudio/release-service-catalog"}, - {Name: "revision", Value: "main"}, + {Name: "url", Value: releasecommon.RelSvcCatalogURL}, + {Name: "revision", Value: releasecommon.RelSvcCatalogRevision}, {Name: "pathInRepo", Value: "pipelines/e2e/e2e.yaml"}, }, }, &runtime.RawExtension{ @@ -118,10 +118,10 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe }) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.TektonController.CreateEnterpriseContractPolicy(releaseConst.ReleaseStrategyPolicyDefault, managedNamespace, policy) + _, err = fw.AsKubeAdmin.TektonController.CreateEnterpriseContractPolicy(releasecommon.ReleaseStrategyPolicyDefault, managedNamespace, policy) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.TektonController.CreatePVCInAccessMode(releaseConst.ReleasePvcName, managedNamespace, corev1.ReadWriteOnce) + _, err = fw.AsKubeAdmin.TektonController.CreatePVCInAccessMode(releasecommon.ReleasePvcName, managedNamespace, corev1.ReadWriteOnce) Expect(err).NotTo(HaveOccurred()) _, err = fw.AsKubeAdmin.CommonController.CreateRole("role-release-service-account", managedNamespace, map[string][]string{ @@ -131,7 +131,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe }) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.CommonController.CreateRoleBinding("role-release-service-account-binding", managedNamespace, "ServiceAccount", releaseConst.ReleasePipelineServiceAccountDefault, managedNamespace, "Role", "role-release-service-account", "rbac.authorization.k8s.io") + _, err = fw.AsKubeAdmin.CommonController.CreateRoleBinding("role-release-service-account-binding", managedNamespace, "ServiceAccount", releasecommon.ReleasePipelineServiceAccountDefault, managedNamespace, "Role", "role-release-service-account", "rbac.authorization.k8s.io") Expect(err).NotTo(HaveOccurred()) }) @@ -152,7 +152,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe Eventually(func() error { releaseCR, err = fw.AsKubeAdmin.ReleaseController.GetFirstReleaseInNamespace(devNamespace) return err - }, releaseConst.ReleaseCreationTimeout, releaseConst.DefaultInterval).Should(Succeed()) + }, releasecommon.ReleaseCreationTimeout, releasecommon.DefaultInterval).Should(Succeed()) }) It("verifies that Release PipelineRun is triggered", func() { @@ -166,7 +166,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe return fmt.Errorf("pipelinerun %s/%s hasn't started yet", pr.GetNamespace(), pr.GetName()) } return nil - }, releaseConst.ReleasePipelineRunCreationTimeout, releaseConst.DefaultInterval).Should(Succeed(), fmt.Sprintf("timed out waiting for a pipelinerun to start for a release %s/%s", releaseCR.GetName(), releaseCR.GetNamespace())) + }, releasecommon.ReleasePipelineRunCreationTimeout, releasecommon.DefaultInterval).Should(Succeed(), fmt.Sprintf("timed out waiting for a pipelinerun to start for a release %s/%s", releaseCR.GetName(), releaseCR.GetNamespace())) }) It("verifies that Release PipelineRun should eventually succeed", func() { @@ -178,7 +178,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe } Expect(tekton.HasPipelineRunSucceeded(pr)).To(BeTrue(), fmt.Sprintf("release pipelinerun %s/%s did not succeed", pr.GetNamespace(), pr.GetName())) return nil - }, releaseConst.ReleasePipelineRunCompletionTimeout, releaseConst.DefaultInterval).Should(Succeed()) + }, releasecommon.ReleasePipelineRunCompletionTimeout, releasecommon.DefaultInterval).Should(Succeed()) }) It("verifies that Enterprise Contract Task has succeeded in the Release PipelineRun", func() { @@ -190,7 +190,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe GinkgoWriter.Printf("the status of the %s TaskRun on the release pipeline is: %v", verifyEnterpriseContractTaskName, ecTaskRunStatus.Status.Conditions) Expect(tekton.DidTaskSucceed(ecTaskRunStatus)).To(BeTrue()) return nil - }, releaseConst.ReleasePipelineRunCompletionTimeout, releaseConst.DefaultInterval).Should(Succeed()) + }, releasecommon.ReleasePipelineRunCompletionTimeout, releasecommon.DefaultInterval).Should(Succeed()) }) It("verifies that a Release is marked as succeeded.", func() { @@ -203,7 +203,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe return fmt.Errorf("release %s/%s is not marked as finished yet", releaseCR.GetNamespace(), releaseCR.GetName()) } return nil - }, releaseConst.ReleaseCreationTimeout, releaseConst.DefaultInterval).Should(Succeed()) + }, releasecommon.ReleaseCreationTimeout, releasecommon.DefaultInterval).Should(Succeed()) }) }) }) diff --git a/tests/release/service/happy_path_with_deployment.go b/tests/release/service/happy_path_with_deployment.go index e0784c8a1..0360cf535 100644 --- a/tests/release/service/happy_path_with_deployment.go +++ b/tests/release/service/happy_path_with_deployment.go @@ -15,7 +15,7 @@ import ( "github.com/redhat-appstudio/e2e-tests/pkg/utils" "github.com/redhat-appstudio/e2e-tests/pkg/utils/contract" "github.com/redhat-appstudio/e2e-tests/pkg/utils/tekton" - releaseConst "github.com/redhat-appstudio/e2e-tests/tests/release" + releasecommon "github.com/redhat-appstudio/e2e-tests/tests/release" releaseApi "github.com/redhat-appstudio/release-service/api/v1alpha1" tektonutils "github.com/redhat-appstudio/release-service/tekton/utils" corev1 "k8s.io/api/core/v1" @@ -48,26 +48,26 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe sourceAuthJson := utils.GetEnv("QUAY_TOKEN", "") Expect(sourceAuthJson).ToNot(BeEmpty()) - _, err = fw.AsKubeAdmin.CommonController.CreateRegistryAuthSecret(releaseConst.RedhatAppstudioUserSecret, managedNamespace, sourceAuthJson) + _, err = fw.AsKubeAdmin.CommonController.CreateRegistryAuthSecret(releasecommon.RedhatAppstudioUserSecret, managedNamespace, sourceAuthJson) Expect(err).ToNot(HaveOccurred()) - err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(devNamespace, releaseConst.HacbsReleaseTestsTokenSecret, constants.DefaultPipelineServiceAccount, true) + err = fw.AsKubeAdmin.CommonController.LinkSecretToServiceAccount(devNamespace, releasecommon.HacbsReleaseTestsTokenSecret, constants.DefaultPipelineServiceAccount, true) Expect(err).ToNot(HaveOccurred()) publicKey, err := fw.AsKubeAdmin.TektonController.GetTektonChainsPublicKey() Expect(err).ToNot(HaveOccurred()) Expect(fw.AsKubeAdmin.TektonController.CreateOrUpdateSigningSecret( - publicKey, releaseConst.PublicSecretNameAuth, managedNamespace)).To(Succeed()) + publicKey, releasecommon.PublicSecretNameAuth, managedNamespace)).To(Succeed()) defaultEcPolicy, err := fw.AsKubeAdmin.TektonController.GetEnterpriseContractPolicy("default", "enterprise-contract-service") Expect(err).NotTo(HaveOccurred()) policy := contract.PolicySpecWithSourceConfig(defaultEcPolicy.Spec, ecp.SourceConfig{Include: []string{"@minimal"}, Exclude: []string{"cve"}}) // using cdq since git ref is not known - compName = releaseConst.ComponentName + compName = releasecommon.ComponentName var componentDetected appservice.ComponentDetectionDescription - cdq, err := fw.AsKubeAdmin.HasController.CreateComponentDetectionQuery(compName, devNamespace, releaseConst.GitSourceComponentUrl, "", "", "", false) + cdq, err := fw.AsKubeAdmin.HasController.CreateComponentDetectionQuery(compName, devNamespace, releasecommon.GitSourceComponentUrl, "", "", "", false) Expect(err).NotTo(HaveOccurred()) Expect(cdq.Status.ComponentDetected).To(HaveLen(1), "Expected length of the detected Components was not 1") @@ -76,29 +76,29 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe componentDetected = compDetected } - _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlan(releaseConst.SourceReleasePlanName, devNamespace, releaseConst.ApplicationNameDefault, managedNamespace, "") + _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlan(releasecommon.SourceReleasePlanName, devNamespace, releasecommon.ApplicationNameDefault, managedNamespace, "") Expect(err).NotTo(HaveOccurred()) _, err = fw.AsKubeAdmin.GitOpsController.CreatePocEnvironment(releaseEnvironment, managedNamespace) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releaseConst.TargetReleasePlanAdmissionName, managedNamespace, releaseEnvironment, devNamespace, releaseConst.ReleaseStrategyPolicyDefault, releaseConst.ReleasePipelineServiceAccountDefault, []string{releaseConst.ApplicationNameDefault}, true, &tektonutils.PipelineRef{ + _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, releaseEnvironment, devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{ Resolver: "git", Params: []tektonutils.Param{ - {Name: "url", Value: "https://github.com/redhat-appstudio/release-service-catalog"}, - {Name: "revision", Value: "main"}, + {Name: "url", Value: releasecommon.RelSvcCatalogURL}, + {Name: "revision", Value: releasecommon.RelSvcCatalogRevision}, {Name: "pathInRepo", Value: "pipelines/e2e/e2e.yaml"}, }, }, nil) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.TektonController.CreateEnterpriseContractPolicy(releaseConst.ReleaseStrategyPolicyDefault, managedNamespace, policy) + _, err = fw.AsKubeAdmin.TektonController.CreateEnterpriseContractPolicy(releasecommon.ReleaseStrategyPolicyDefault, managedNamespace, policy) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.TektonController.CreatePVCInAccessMode(releaseConst.ReleasePvcName, managedNamespace, corev1.ReadWriteOnce) + _, err = fw.AsKubeAdmin.TektonController.CreatePVCInAccessMode(releasecommon.ReleasePvcName, managedNamespace, corev1.ReadWriteOnce) Expect(err).NotTo(HaveOccurred()) - managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releaseConst.ReleasePipelineServiceAccountDefault, managedNamespace, releaseConst.ManagednamespaceSecret, nil) + managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releasecommon.ReleasePipelineServiceAccountDefault, managedNamespace, releasecommon.ManagednamespaceSecret, nil) Expect(err).NotTo(HaveOccurred()) _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(devNamespace, managedServiceAccount) @@ -113,13 +113,13 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe }) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.CommonController.CreateRoleBinding("role-release-service-account-binding", managedNamespace, "ServiceAccount", releaseConst.ReleasePipelineServiceAccountDefault, managedNamespace, "Role", "role-release-service-account", "rbac.authorization.k8s.io") + _, err = fw.AsKubeAdmin.CommonController.CreateRoleBinding("role-release-service-account-binding", managedNamespace, "ServiceAccount", releasecommon.ReleasePipelineServiceAccountDefault, managedNamespace, "Role", "role-release-service-account", "rbac.authorization.k8s.io") Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.HasController.CreateApplication(releaseConst.ApplicationNameDefault, devNamespace) + _, err = fw.AsKubeAdmin.HasController.CreateApplication(releasecommon.ApplicationNameDefault, devNamespace) Expect(err).NotTo(HaveOccurred()) - component, err = fw.AsKubeAdmin.HasController.CreateComponent(componentDetected.ComponentStub, devNamespace, "", "", releaseConst.ApplicationNameDefault, true, map[string]string{}) + component, err = fw.AsKubeAdmin.HasController.CreateComponent(componentDetected.ComponentStub, devNamespace, "", "", releasecommon.ApplicationNameDefault, true, map[string]string{}) Expect(err).NotTo(HaveOccurred()) workingDir, err := os.Getwd() @@ -136,7 +136,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe args = []string{"775", "copy-application.sh"} Expect(utils.ExecuteCommandInASpecificDirectory("chmod", args, workingDir)).To(Succeed()) // Copying application in dev namespace to managed namespace - args = []string{managedNamespace, "-a", devNamespace + "/" + releaseConst.ApplicationNameDefault} + args = []string{managedNamespace, "-a", devNamespace + "/" + releasecommon.ApplicationNameDefault} Expect(utils.ExecuteCommandInASpecificDirectory("./copy-application.sh", args, workingDir)).To(Succeed()) }) @@ -159,7 +159,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe Eventually(func() error { releaseCR, err = fw.AsKubeAdmin.ReleaseController.GetFirstReleaseInNamespace(devNamespace) return err - }, releaseConst.ReleaseCreationTimeout, releaseConst.DefaultInterval).Should(Succeed()) + }, releasecommon.ReleaseCreationTimeout, releasecommon.DefaultInterval).Should(Succeed()) }) It("verifies that Release PipelineRun is triggered", func() { @@ -173,7 +173,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe return fmt.Errorf("pipelinerun %s/%s hasn't started yet", pr.GetNamespace(), pr.GetName()) } return nil - }, releaseConst.ReleasePipelineRunCreationTimeout, releaseConst.DefaultInterval).Should(Succeed(), fmt.Sprintf("timed out waiting for a pipelinerun to start for a release %s/%s", releaseCR.GetName(), releaseCR.GetNamespace())) + }, releasecommon.ReleasePipelineRunCreationTimeout, releasecommon.DefaultInterval).Should(Succeed(), fmt.Sprintf("timed out waiting for a pipelinerun to start for a release %s/%s", releaseCR.GetName(), releaseCR.GetNamespace())) }) It("verifies that Release PipelineRun should eventually succeed", func() { @@ -185,7 +185,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe } Expect(tekton.HasPipelineRunSucceeded(pr)).To(BeTrue(), fmt.Sprintf("release pipelinerun %s/%s did not succeed", pr.GetNamespace(), pr.GetName())) return nil - }, releaseConst.ReleasePipelineRunCompletionTimeout, releaseConst.DefaultInterval).Should(Succeed()) + }, releasecommon.ReleasePipelineRunCompletionTimeout, releasecommon.DefaultInterval).Should(Succeed()) }) // phase Deployed happens before phase Released It("tests a Release CR reports that the deployment was successful", func() { @@ -198,7 +198,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe return fmt.Errorf("release %s/%s is not marked as deployed yet", releaseCR.GetNamespace(), releaseCR.GetName()) } return nil - }, releaseDeploymentTimeout, releaseConst.DefaultInterval).Should(Succeed()) + }, releaseDeploymentTimeout, releasecommon.DefaultInterval).Should(Succeed()) }) It("tests a Release CR is marked as successfully deployed", func() { Eventually(func() error { @@ -210,7 +210,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe return fmt.Errorf("release %s/%s is not marked as finished yet", releaseCR.GetNamespace(), releaseCR.GetName()) } return nil - }, releaseFinishedTimeout, releaseConst.DefaultInterval).Should(Succeed()) + }, releaseFinishedTimeout, releasecommon.DefaultInterval).Should(Succeed()) }) }) }) diff --git a/tests/release/service/missing_release_plan_and_admission.go b/tests/release/service/missing_release_plan_and_admission.go index 02f5bcf36..8ef26edfe 100644 --- a/tests/release/service/missing_release_plan_and_admission.go +++ b/tests/release/service/missing_release_plan_and_admission.go @@ -6,7 +6,7 @@ import ( "github.com/redhat-appstudio/application-api/api/v1alpha1" tektonutils "github.com/redhat-appstudio/release-service/tekton/utils" - releaseConst "github.com/redhat-appstudio/e2e-tests/tests/release" + releasecommon "github.com/redhat-appstudio/e2e-tests/tests/release" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -42,19 +42,19 @@ var _ = framework.ReleaseServiceSuiteDescribe("[HACBS-2360] Release CR fails whe _, err = fw.AsKubeAdmin.CommonController.CreateTestNamespace(managedNamespace) Expect(err).NotTo(HaveOccurred(), "Error when creating namespace '%s': %v", managedNamespace, err) - _, err = fw.AsKubeAdmin.IntegrationController.CreateSnapshotWithComponents(snapshotName, "", releaseConst.ApplicationName, devNamespace, []v1alpha1.SnapshotComponent{}) + _, err = fw.AsKubeAdmin.IntegrationController.CreateSnapshotWithComponents(snapshotName, "", releasecommon.ApplicationName, devNamespace, []v1alpha1.SnapshotComponent{}) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(destinationReleasePlanAdmissionName, managedNamespace, "", devNamespace, releaseConst.ReleaseStrategyPolicy, constants.DefaultPipelineServiceAccount, []string{releaseConst.ApplicationName}, true, &tektonutils.PipelineRef{ + _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(destinationReleasePlanAdmissionName, managedNamespace, "", devNamespace, releasecommon.ReleaseStrategyPolicy, constants.DefaultPipelineServiceAccount, []string{releasecommon.ApplicationName}, true, &tektonutils.PipelineRef{ Resolver: "git", Params: []tektonutils.Param{ - {Name: "url", Value: "https://github.com/redhat-appstudio/release-service-catalog"}, - {Name: "revision", Value: "main"}, + {Name: "url", Value: releasecommon.RelSvcCatalogURL}, + {Name: "revision", Value: releasecommon.RelSvcCatalogRevision}, {Name: "pathInRepo", Value: "pipelines/e2e/e2e.yaml"}, }, }, nil) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.ReleaseController.CreateRelease(releaseName, devNamespace, snapshotName, releaseConst.SourceReleasePlanName) + _, err = fw.AsKubeAdmin.ReleaseController.CreateRelease(releaseName, devNamespace, snapshotName, releasecommon.SourceReleasePlanName) Expect(err).NotTo(HaveOccurred()) }) @@ -74,7 +74,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("[HACBS-2360] Release CR fails whe strings.Contains(releaseCR.Status.Conditions[0].Message, "Release validation failed") } return false - }, releaseConst.ReleaseCreationTimeout, releaseConst.DefaultInterval).Should(BeTrue()) + }, releasecommon.ReleaseCreationTimeout, releasecommon.DefaultInterval).Should(BeTrue()) }) It("missing ReleasePlanAdmission makes a Release CR set as failed in both IsReleased and IsValid with a proper message to user.", func() { Expect(fw.AsKubeAdmin.ReleaseController.DeleteReleasePlanAdmission(destinationReleasePlanAdmissionName, managedNamespace, false)).NotTo(HaveOccurred()) @@ -85,7 +85,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("[HACBS-2360] Release CR fails whe strings.Contains(releaseCR.Status.Conditions[0].Message, "Release validation failed") } return false - }, releaseConst.ReleaseCreationTimeout, releaseConst.DefaultInterval).Should(BeTrue()) + }, releasecommon.ReleaseCreationTimeout, releasecommon.DefaultInterval).Should(BeTrue()) }) }) }) diff --git a/tests/release/service/release_plan_and_admission_matched.go b/tests/release/service/release_plan_and_admission_matched.go index 28887c0a0..00e950f8c 100644 --- a/tests/release/service/release_plan_and_admission_matched.go +++ b/tests/release/service/release_plan_and_admission_matched.go @@ -71,8 +71,8 @@ var _ = framework.ReleaseServiceSuiteDescribe("ReleasePlan and ReleasePlanAdmiss _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, "", devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{ Resolver: "git", Params: []tektonutils.Param{ - {Name: "url", Value: "https://github.com/redhat-appstudio/release-service-catalog"}, - {Name: "revision", Value: "main"}, + {Name: "url", Value: releasecommon.RelSvcCatalogURL}, + {Name: "revision", Value: releasecommon.RelSvcCatalogRevision}, {Name: "pathInRepo", Value: "pipelines/e2e/e2e.yaml"}, }, }, nil) diff --git a/tests/release/service/release_plan_owner_ref.go b/tests/release/service/release_plan_owner_ref.go index d95b48923..d79f9c943 100644 --- a/tests/release/service/release_plan_owner_ref.go +++ b/tests/release/service/release_plan_owner_ref.go @@ -10,7 +10,7 @@ import ( "github.com/redhat-appstudio/e2e-tests/pkg/framework" "github.com/redhat-appstudio/e2e-tests/pkg/utils" - releaseConst "github.com/redhat-appstudio/e2e-tests/tests/release" + releasecommon "github.com/redhat-appstudio/e2e-tests/tests/release" releaseApi "github.com/redhat-appstudio/release-service/api/v1alpha1" ) @@ -28,10 +28,10 @@ var _ = framework.ReleaseServiceSuiteDescribe("[HACBS-2469]test-releaseplan-owne Expect(err).NotTo(HaveOccurred()) devNamespace = fw.UserNamespace - _, err = fw.AsKubeAdmin.HasController.CreateApplication(releaseConst.ApplicationNameDefault, devNamespace) + _, err = fw.AsKubeAdmin.HasController.CreateApplication(releasecommon.ApplicationNameDefault, devNamespace) Expect(err).NotTo(HaveOccurred()) - _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlan(releaseConst.SourceReleasePlanName, devNamespace, releaseConst.ApplicationNameDefault, "managed", "true") + _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlan(releasecommon.SourceReleasePlanName, devNamespace, releasecommon.ApplicationNameDefault, "managed", "true") Expect(err).NotTo(HaveOccurred()) }) @@ -44,7 +44,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("[HACBS-2469]test-releaseplan-owne var _ = Describe("ReleasePlan verification", Ordered, func() { It("verifies that the ReleasePlan has an owner reference for the application", func() { Eventually(func() error { - releasePlan, err = fw.AsKubeAdmin.ReleaseController.GetReleasePlan(releaseConst.SourceReleasePlanName, devNamespace) + releasePlan, err = fw.AsKubeAdmin.ReleaseController.GetReleasePlan(releasecommon.SourceReleasePlanName, devNamespace) Expect(err).NotTo(HaveOccurred()) if len(releasePlan.OwnerReferences) != 1 { @@ -52,22 +52,22 @@ var _ = framework.ReleaseServiceSuiteDescribe("[HACBS-2469]test-releaseplan-owne } ownerRef := releasePlan.OwnerReferences[0] - if ownerRef.Name != releaseConst.ApplicationNameDefault { - return fmt.Errorf("ReleasePlan %s have OwnerReference Name %s and it's not as expected in Application Name %s", releasePlan.Name, ownerRef.Name, releaseConst.ApplicationNameDefault) + if ownerRef.Name != releasecommon.ApplicationNameDefault { + return fmt.Errorf("ReleasePlan %s have OwnerReference Name %s and it's not as expected in Application Name %s", releasePlan.Name, ownerRef.Name, releasecommon.ApplicationNameDefault) } return nil - }, releasePlanOwnerReferencesTimeout, releaseConst.DefaultInterval).Should(Succeed(), "timed out waiting for ReleasePlan OwnerReference to be set.") + }, releasePlanOwnerReferencesTimeout, releasecommon.DefaultInterval).Should(Succeed(), "timed out waiting for ReleasePlan OwnerReference to be set.") }) It("verifies that the ReleasePlan is deleted if the application is deleted", func() { - Expect(fw.AsKubeAdmin.HasController.DeleteApplication(releaseConst.ApplicationNameDefault, devNamespace, true)).To(Succeed()) + Expect(fw.AsKubeAdmin.HasController.DeleteApplication(releasecommon.ApplicationNameDefault, devNamespace, true)).To(Succeed()) Eventually(func() error { - releasePlan, err = fw.AsKubeAdmin.ReleaseController.GetReleasePlan(releaseConst.SourceReleasePlanName, devNamespace) + releasePlan, err = fw.AsKubeAdmin.ReleaseController.GetReleasePlan(releasecommon.SourceReleasePlanName, devNamespace) if !errors.IsNotFound(err) { - return fmt.Errorf("ReleasePlan %s for application %s still not deleted\n", releasePlan.GetName(), releaseConst.ApplicationNameDefault) + return fmt.Errorf("ReleasePlan %s for application %s still not deleted\n", releasePlan.GetName(), releasecommon.ApplicationNameDefault) } return nil - }, 1*time.Minute, releaseConst.DefaultInterval).Should(Succeed(), "timed out waiting for ReleasePlan to be deleted in %s namespace", devNamespace) + }, 1*time.Minute, releasecommon.DefaultInterval).Should(Succeed(), "timed out waiting for ReleasePlan to be deleted in %s namespace", devNamespace) }) }) }) diff --git a/tests/rhtap-demo/rhtap-demo.go b/tests/rhtap-demo/rhtap-demo.go index d4fb95a82..b6e7c33e1 100644 --- a/tests/rhtap-demo/rhtap-demo.go +++ b/tests/rhtap-demo/rhtap-demo.go @@ -35,6 +35,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" pointer "k8s.io/utils/ptr" + releasecommon "github.com/redhat-appstudio/e2e-tests/tests/release" integrationv1beta1 "github.com/redhat-appstudio/integration-service/api/v1beta1" releaseApi "github.com/redhat-appstudio/release-service/api/v1alpha1" tektonapi "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" @@ -769,8 +770,8 @@ func createReleaseConfig(fw framework.Framework, managedNamespace, componentName _, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission("demo", managedNamespace, "", fw.UserNamespace, ecPolicyName, "release-service-account", []string{appName}, true, &tektonutils.PipelineRef{ Resolver: "git", Params: []tektonutils.Param{ - {Name: "url", Value: "https://github.com/redhat-appstudio/release-service-catalog"}, - {Name: "revision", Value: "main"}, + {Name: "url", Value: releasecommon.RelSvcCatalogURL}, + {Name: "revision", Value: releasecommon.RelSvcCatalogRevision}, {Name: "pathInRepo", Value: "pipelines/e2e/e2e.yaml"}, }, }, nil)