Skip to content

Commit

Permalink
Attempt at fixing list/describe binding tests; fixes old mishap
Browse files Browse the repository at this point in the history
Signed-off-by: Parthvi Vala <pvala@redhat.com>
  • Loading branch information
valaparthvi committed Dec 6, 2022
1 parent e1d9a98 commit eec32f0
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions tests/integration/cmd_describe_list_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,23 +489,6 @@ var _ = Describe("odo describe/list binding command tests", func() {
cmpName := "my-nodejs-app"
BeforeEach(func() {
helper.Cmd("odo", "init", "--name", cmpName, "--devfile-path", ctx.devfile).ShouldPass()

if ctx.isServiceNsSupported && ns != "" {
ns = commonVar.CliRunner.CreateAndSetRandNamespaceProject()

commonVar.CliRunner.SetProject(commonVar.Project)

helper.ReplaceString(filepath.Join(commonVar.Context, "devfile.yaml"),
"name: cluster-sample",
fmt.Sprintf(`name: cluster-sample
namespace: %s`, ns))
}
})

AfterEach(func() {
if ctx.isServiceNsSupported && ns != "" {
commonVar.CliRunner.DeleteNamespaceProject(ns, false)
}
})

When("Starting a Pg service", func() {
Expand All @@ -517,11 +500,12 @@ var _ = Describe("odo describe/list binding command tests", func() {
out, _ := commonVar.CliRunner.GetBindableKinds()
return out
}, 120, 3).Should(ContainSubstring("Cluster"))
addBindableKind := commonVar.CliRunner.Run("apply", "-f", helper.GetExamplePath("manifests", "bindablekind-instance.yaml"))
Expect(addBindableKind.ExitCode()).To(BeEquivalentTo(0))
commonVar.CliRunner.EnsurePodIsUp(commonVar.Project, "cluster-sample-1")

if ctx.isServiceNsSupported && ns != "" {
ns = commonVar.CliRunner.CreateAndSetRandNamespaceProject()
// Reset the original project
commonVar.CliRunner.SetProject(commonVar.Project)

addBindableKindInOtherNs := commonVar.CliRunner.Run("-n", ns, "apply", "-f",
helper.GetExamplePath("manifests", "bindablekind-instance.yaml"))
Expect(addBindableKindInOtherNs.ExitCode()).To(BeEquivalentTo(0))
Expand All @@ -530,6 +514,17 @@ var _ = Describe("odo describe/list binding command tests", func() {
"name: cluster-sample",
fmt.Sprintf(`name: cluster-sample
namespace: %s`, ns))
commonVar.CliRunner.EnsurePodIsUp(ns, "cluster-sample-1")
} else {
addBindableKind := commonVar.CliRunner.Run("apply", "-f", helper.GetExamplePath("manifests", "bindablekind-instance.yaml"))
Expect(addBindableKind.ExitCode()).To(BeEquivalentTo(0))
commonVar.CliRunner.EnsurePodIsUp(commonVar.Project, "cluster-sample-1")
}
})

AfterEach(func() {
if ctx.isServiceNsSupported && ns != "" {
commonVar.CliRunner.DeleteNamespaceProject(ns, false)
}
})

Expand Down

0 comments on commit eec32f0

Please sign in to comment.