Fix debug info json test
@@ -6,6 +6,7 @@ import (
"path/filepath"
"runtime"
"strconv"
+ "strings"
"time"
. "github.com/onsi/ginkgo"
@@ -55,9 +56,11 @@ var _ = Describe("odo debug command tests", func() {
// Make sure that the debug information output, outputs correctly.
// We do *not* check the json output since the debugProcessID will be different each time.
helper.WaitForCmdOut("odo", []string{"debug", "info", "--context", context, "-o", "json"}, 1, true, func(output string) bool {
- Expect(output).To(ContainSubstring(`"kind": "OdoDebugInfo"`))
- Expect(output).To(ContainSubstring(`"localPort": ` + freePort))
+ if strings.Contains(output, `"kind": "OdoDebugInfo"`) &&
+ strings.Contains(output, `"localPort": `+freePort) {
return true
+ }
+ return false
})
stopChannel <- true
