Skip to content

Commit

Permalink
fix: update some values in the data of RPA for FBC
Browse files Browse the repository at this point in the history
Signed-off-by: Jing Qi <[email protected]>

Correct the type of some values in the data of RPA for FBC test case
  • Loading branch information
jinqi7 committed Dec 4, 2024
1 parent 5ea0b8c commit a9a7b6b
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions tests/release/pipelines/fbc_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package pipelines
import (
"encoding/json"
"fmt"
"strconv"
"time"

"github.com/devfile/library/v2/pkg/util"
Expand Down Expand Up @@ -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, "", "", "", "")
Expand Down Expand Up @@ -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, "", "", "", "")
Expand Down Expand Up @@ -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"},
Expand Down

0 comments on commit a9a7b6b

Please sign in to comment.