From a9a7b6b093567e550aa462dc039e4180f9696b7b Mon Sep 17 00:00:00 2001 From: Jing Qi Date: Wed, 4 Dec 2024 21:08:39 +0800 Subject: [PATCH] fix: update some values in the data of RPA for FBC Signed-off-by: Jing Qi Correct the type of some values in the data of RPA for FBC test case --- tests/release/pipelines/fbc_release.go | 27 +++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/tests/release/pipelines/fbc_release.go b/tests/release/pipelines/fbc_release.go index 53f246048..a5726938c 100644 --- a/tests/release/pipelines/fbc_release.go +++ b/tests/release/pipelines/fbc_release.go @@ -3,6 +3,7 @@ package pipelines import ( "encoding/json" "fmt" + "strconv" "time" "github.com/devfile/library/v2/pkg/util" @@ -85,7 +86,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("FBC e2e-tests", Label("release- _, err = devFw.AsKubeDeveloper.ReleaseController.CreateReleasePlan(fbcReleasePlanName, devNamespace, fbcApplicationName, managedNamespace, "true", nil, nil, nil) Expect(err).NotTo(HaveOccurred()) - createFBCReleasePlanAdmission(fbcReleasePlanAdmissionName, *managedFw, devNamespace, managedNamespace, fbcApplicationName, fbcEnterpriseContractPolicyName, relSvcCatalogPathInRepo, "false", "", "", "", "", "false") + createFBCReleasePlanAdmission(fbcReleasePlanAdmissionName, *managedFw, devNamespace, managedNamespace, fbcApplicationName, fbcEnterpriseContractPolicyName, relSvcCatalogPathInRepo, "false", "", "false", "", "", "false") createFBCEnterpriseContractPolicy(fbcEnterpriseContractPolicyName, *managedFw, devNamespace, managedNamespace) snapshot, err = releasecommon.CreateSnapshotWithImageSource(*devFw, fbcComponentName, fbcApplicationName, devNamespace, sampleImage, fbcSourceGitURL, fbcGitSrcSHA, "", "", "", "") @@ -134,7 +135,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("FBC e2e-tests", Label("release- _, err = devFw.AsKubeDeveloper.ReleaseController.CreateReleasePlan(fbcStagedRPName, devNamespace, fbcStagedAppName, managedNamespace, "true", nil, nil, nil) Expect(err).NotTo(HaveOccurred()) - createFBCReleasePlanAdmission(fbcStagedRPAName, *managedFw, devNamespace, managedNamespace, fbcStagedAppName, fbcStagedECPolicyName, relSvcCatalogPathInRepo, "false", "", "", "", "", "true") + createFBCReleasePlanAdmission(fbcStagedRPAName, *managedFw, devNamespace, managedNamespace, fbcStagedAppName, fbcStagedECPolicyName, relSvcCatalogPathInRepo, "false", "", "false", "", "", "true") createFBCEnterpriseContractPolicy(fbcStagedECPolicyName, *managedFw, devNamespace, managedNamespace) snapshot, err = releasecommon.CreateSnapshotWithImageSource(*devFw, fbcStagedCompName, fbcStagedAppName, devNamespace, sampleImage, fbcSourceGitURL, fbcGitSrcSHA, "", "", "", "") @@ -341,16 +342,28 @@ func createFBCEnterpriseContractPolicy(fbcECPName string, managedFw framework.Fr func createFBCReleasePlanAdmission(fbcRPAName string, managedFw framework.Framework, devNamespace, managedNamespace, fbcAppName, fbcECPName, pathInRepoValue, hotfix, issueId, preGA, productName, productVersion, isStagedIndex string) { var err error + + hotFix, err := strconv.ParseBool(hotfix) + Expect(err).NotTo(HaveOccurred()) + pre_GA, err := strconv.ParseBool(preGA) + Expect(err).NotTo(HaveOccurred()) + stagedIndex, err := strconv.ParseBool(isStagedIndex) + Expect(err).NotTo(HaveOccurred()) + + if productName == "" { + productName = "testProductName" + } + data, err := json.Marshal(map[string]interface{}{ "fbc": map[string]interface{}{ "fromIndex": constants.FromIndex, - "stagedIndex": isStagedIndex, + "stagedIndex": stagedIndex, "publishingCredentials": "fbc-preview-publishing-credentials", - "requestUpdateTimeout": "1500", - "buildTimeoutSeconds": "1500", - "hotfix": hotfix, + "requestTimeoutSeconds": 1500, + "buildTimeoutSeconds": 1500, + "hotfix": hotFix, "issueId": issueId, - "preGA": preGA, + "preGA": pre_GA, "productName": productName, "productVersion": productVersion, "allowedPackages": []string{"example-operator"},