Skip to content

Commit

Permalink
[marketplace] Remove CSC related tests
Browse files Browse the repository at this point in the history
The CatalogSourceConfig is being deprecated from Openshift 4.5.
This PR removes the CSC related tests.
Ref: operator-framework/operator-marketplace#302
  • Loading branch information
anik120 committed Apr 20, 2020
1 parent 4918af1 commit 97665d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 48 deletions.
14 changes: 1 addition & 13 deletions test/extended/marketplace/marketplace_diffname.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ var _ = g.Describe("[sig-operator][Feature:Marketplace] Marketplace diff name te

var (
oc = exutil.NewCLI("marketplace")
allNs = "openshift-operators"
marketplaceNs = "openshift-marketplace"
resourceWait = 60 * time.Second

opsrcYamltem = exutil.FixturePath("testdata", "marketplace", "opsrc", "02-opsrc.yaml")
cscYamltem = exutil.FixturePath("testdata", "marketplace", "csc", "02-csc.yaml")
)

g.AfterEach(func() {
Expand All @@ -40,7 +38,7 @@ var _ = g.Describe("[sig-operator][Feature:Marketplace] Marketplace diff name te
}
})

//OCP-25672 create a opsrc named "samename", then create a csc also named "samename"
//OCP-25672 create a opsrc named "samename"
g.It("[ocp-25672] create the samename opsrc&csc [Serial]", func() {

// Create one opsrc samename
Expand Down Expand Up @@ -74,15 +72,5 @@ var _ = g.Describe("[sig-operator][Feature:Marketplace] Marketplace diff name te
msg, _ := existResources(oc, source[0], source[1], source[2])
o.Expect(msg).Should(o.BeTrue())
}

// Create the csc samename
cscYaml, err := oc.AsAdmin().Run("process").Args("--ignore-unknown-parameters=true", "-f", cscYamltem, "-p", "NAME=samename", fmt.Sprintf("NAMESPACE=%s", allNs), fmt.Sprintf("MARKETPLACE=%s", marketplaceNs), "PACKAGES=camel-k-marketplace-e2e-tests", "DISPLAYNAME=samename", "PUBLISHER=samename").OutputToFile("config.json")
err = createResources(oc, cscYaml)
o.Expect(err).NotTo(o.HaveOccurred())
// Check the csc status
outMesg, _ := oc.AsAdmin().WithoutNamespace().Run("get").Args("catalogsourceconfig", "samename", "-o=jsonpath={.status.currentPhase.phase.message}", "-n", marketplaceNs).Output()
o.Expect(outMesg).Should(o.ContainSubstring("Deployment samename exists"))
outStatus, _ := oc.AsAdmin().WithoutNamespace().Run("get").Args("catalogsourceconfig", "samename", "-o=jsonpath={.status.currentPhase.phase.name}", "-n", marketplaceNs).Output()
o.Expect(outStatus).Should(o.ContainSubstring("Configuring"))
})
})
35 changes: 0 additions & 35 deletions test/extended/marketplace/marketplace_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@ var _ = g.Describe("[sig-operator][Feature:Marketplace] Marketplace resources wi

var (
oc = exutil.NewCLI("marketplace")
allNs = "openshift-operators"
marketplaceNs = "openshift-marketplace"
resourceWait = 60 * time.Second

opsrcYamltem = exutil.FixturePath("testdata", "marketplace", "opsrc", "02-opsrc.yaml")
cscYamltem = exutil.FixturePath("testdata", "marketplace", "csc", "02-csc.yaml")
)

g.AfterEach(func() {
// Clear the sub,csv resource
allresourcelist := [][]string{
{"operatorsource", "opsrctestlabel", marketplaceNs},
{"catalogsourceconfig", "csctestlabel", marketplaceNs},
}

for _, source := range allresourcelist {
Expand Down Expand Up @@ -78,38 +75,6 @@ var _ = g.Describe("[sig-operator][Feature:Marketplace] Marketplace resources wi
msg, _ := getResourceByPath(oc, source[0], source[1], source[2], source[3])
o.Expect(msg).Should(o.ContainSubstring("optestlabel"))
}
// Create one csc with provider&display&labels
cscYaml, err := oc.AsAdmin().Run("process").Args("--ignore-unknown-parameters=true", "-f", cscYamltem, "-p", "NAME=csctestlabel", fmt.Sprintf("NAMESPACE=%s", allNs), fmt.Sprintf("MARKETPLACE=%s", marketplaceNs), "PACKAGES=camel-k-marketplace-e2e-tests", "DISPLAYNAME=csctestlabel", "PUBLISHER=csctestlabel").OutputToFile("config.json")
err = createResources(oc, cscYaml)
o.Expect(err).NotTo(o.HaveOccurred())

// Wait for the csc is created finished
err = wait.Poll(5*time.Second, resourceWait, func() (bool, error) {
output, err := oc.AsAdmin().Run("get").Args("catalogsourceconfig", "csctestlabel", "-o=jsonpath={.status.currentPhase.phase.message}", "-n", marketplaceNs).Output()
if err != nil {
e2e.Failf("Failed to create csctestlabel, error:%v", err)
return false, err
}
if strings.Contains(output, "has been successfully reconciled") {
return true, nil
}
return false, nil
})

o.Expect(err).NotTo(o.HaveOccurred())

cscResourceList := [][]string{
{"catalogsourceconfig", "csctestlabel", "-o=jsonpath={.spec.csDisplayName}", marketplaceNs},
{"catalogsourceconfig", "csctestlabel", "-o=jsonpath={.spec.csPublisher}", marketplaceNs},
{"catalogsource", "csctestlabel", "-o=jsonpath={.spec.displayName}", allNs},
{"catalogsource", "csctestlabel", "-o=jsonpath={.spec.publisher}", allNs},
}

// Check the displayname,provider oc csc & catalogsource
for _, source := range cscResourceList {
msg, _ := getResourceByPath(oc, source[0], source[1], source[2], source[3])
o.Expect(msg).Should(o.ContainSubstring("csctestlabel"))
}

// Get the packagelist of opsrctestlabel
packageListOpsrc1, _ := getResourceByPath(oc, "operatorsource", "opsrctestlabel", "-o=jsonpath={.status.packages}", marketplaceNs)
Expand Down

0 comments on commit 97665d2

Please sign in to comment.