Skip to content

Commit

Permalink
3823 refactor json (#4296)
Browse files Browse the repository at this point in the history
* 3377 adding odo devfile support test

* #3377 replaced spaces with a Tab

* #3377 updated focus value

* #3823 new func to match JSON path values and updated test scripts to use it

* added . to import

* updated Makefile to aff gjson

* modified Makefile for gjson

* adding go.mo, go.sum and vendor for new gjson dependency

* removed unnecessary changes

* Removed unused import

* Removing if block

* Fixed expected strings for JSON matcher

* Fixed json paths and values to be compared

* Fixed JSON paths and expected values

* fixed required flags for expected failure

* Removed comment in failing code

* Fixed expected output line 164

* removed commented code
  • Loading branch information
rnapoles-rh committed Dec 21, 2020
1 parent 051ad88 commit 14c98ec
Show file tree
Hide file tree
Showing 34 changed files with 4,658 additions and 139 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ require (
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.6.1
github.com/xanzy/ssh-agent v0.3.0 // indirect
github.com/tidwall/gjson v1.6.3
github.com/zalando/go-keyring v0.1.0
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 // indirect
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect
Expand Down
17 changes: 7 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHS
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.15-0.20200113171025-3fe6c5262873 h1:93nQ7k53GjoMQ07HVP8g6Zj1fQZDDj7Xy2VkNNtvX8o=
github.com/Microsoft/go-winio v0.4.15-0.20200113171025-3fe6c5262873/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15 h1:qkLXKzb1QoVatRyd/YlXZ/Kg0m5K3SPuoD82jjSOaBc=
github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/hcsshim v0.0.0-20190417211021-672e52e9209d/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg=
Expand Down Expand Up @@ -316,11 +314,8 @@ github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM=
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-git-fixtures/v4 v4.0.1 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp/pqnefH+Bc=
github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbKy9zOy4aAKrJ5pibIRpVO2BXnK1Tlcg+caKI7Ox5M=
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk=
github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM=
github.com/go-git/go-git/v5 v5.2.0 h1:YPBLG/3UK1we1ohRkncLjaXWLW+HKp5QNM/jTli2JgI=
github.com/go-git/go-git/v5 v5.2.0/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
Expand Down Expand Up @@ -904,8 +899,6 @@ github.com/prometheus/tsdb v0.8.0/go.mod h1:fSI0j+IUQrDd7+ZtR9WKIGtoYAYAJUKcKhYL
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
github.com/quobyte/api v0.1.2/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H6VI=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/redhat-developer/service-binding-operator v0.1.1 h1:HsJlqFkAjBgKedg3os9XALjKHqyqQpjZJ7Z+XMgS9Ik=
github.com/redhat-developer/service-binding-operator v0.1.1/go.mod h1:gc/ns7SpvoPSdy9uqp5Abwqm2jNLjzzExul2Nx5wuGQ=
github.com/redhat-developer/service-binding-operator v0.3.0 h1:79FuZinHtInpC5NYmDREiKK8DxmXV1L28OSzENtg8tA=
github.com/redhat-developer/service-binding-operator v0.3.0/go.mod h1:FQgDVBuBvln4TRlPQcTxTnNuJSIhNv3Z/xsMvalLaqo=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
Expand Down Expand Up @@ -981,8 +974,14 @@ github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/tchap/go-patricia v2.3.0+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I=
github.com/thecodeteam/goscaleio v0.1.0/go.mod h1:68sdkZAsK8bvEwBlbQnlLS+xU+hvLYM/iQ8KXej1AwM=
github.com/tidwall/gjson v1.6.3 h1:aHoiiem0dr7GHkW001T1SMTJ7X5PvyekH5WX0whWGnI=
github.com/tidwall/gjson v1.6.3/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0=
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/timakin/bodyclose v0.0.0-20190721030226-87058b9bfcec/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
Expand All @@ -1005,8 +1004,6 @@ github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59b
github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs=
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
Expand Down
16 changes: 16 additions & 0 deletions tests/helper/helper_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
"github.com/openshift/odo/pkg/util"
"github.com/tidwall/gjson"
)

// RandString returns a random string of given length
Expand Down Expand Up @@ -311,3 +312,18 @@ func CommonAfterEach(commonVar CommonVar) {

os.Unsetenv("GLOBALODOCONFIG")
}

// GjsonMatcher validates if []results from gjson.GetMany match the expected values for each json path requested
// Values is an array of results returned by the gjson.GetMany function
// Expected is an array of strings, defines the expected values for each of the paths requested in the gjson.GetMany function
// For documentation about gjson see https://github.com/tidwall/gjson#get-multiple-values-at-once
func GjsonMatcher(values []gjson.Result, expected []string) bool {
matched := 0
for i, v := range values {
if strings.Contains(v.String(), expected[i]) {
matched++
}
}
numVars := len(expected)
return matched == numVars
}
33 changes: 18 additions & 15 deletions tests/integration/cmd_app_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package integration

import (
"fmt"
"path/filepath"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/openshift/odo/tests/helper"
"github.com/tidwall/gjson"
)

var _ = Describe("odo app command tests", func() {
Expand All @@ -30,7 +30,8 @@ var _ = Describe("odo app command tests", func() {
Context("when running help for app command", func() {
It("should display the help", func() {
appHelp := helper.CmdShouldPass("odo", "app", "-h")
Expect(appHelp).To(ContainSubstring("Performs application operations related to your project."))
// Trimmed the end of the message string to make it compatible across clusters
Expect(appHelp).To(ContainSubstring("Performs application operations related to"))
})
})

Expand All @@ -39,8 +40,9 @@ var _ = Describe("odo app command tests", func() {
appList := helper.CmdShouldPass("odo", "app", "list", "--project", commonVar.Project)
Expect(appList).To(ContainSubstring("There are no applications deployed"))
actual := helper.CmdShouldPass("odo", "app", "list", "-o", "json", "--project", commonVar.Project)
desired := `{"kind":"List","apiVersion":"odo.dev/v1alpha1","metadata":{},"items":[]}`
Expect(desired).Should(MatchJSON(actual))
values := gjson.GetMany(actual, "kind", "metadata", "items")
expected := []string{"List", "{}", "[]"}
Expect(helper.GjsonMatcher(values, expected)).To(Equal(true))

appDelete := helper.CmdShouldFail("odo", "app", "delete", "test", "--project", commonVar.Project, "-f")
Expect(appDelete).To(ContainSubstring("test app does not exists"))
Expand All @@ -61,14 +63,14 @@ var _ = Describe("odo app command tests", func() {
appListOutput := helper.CmdShouldPass("odo", "app", "list", "--project", commonVar.Project)
Expect(appListOutput).To(ContainSubstring(appName))
actualCompListJSON := helper.CmdShouldPass("odo", "list", "-o", "json", "--project", commonVar.Project)

desiredCompListJSON := fmt.Sprintf(`{"kind":"List","apiVersion":"odo.dev/v1alpha1","metadata":{},"s2iComponents":[{"kind":"Component","apiVersion":"odo.dev/v1alpha1","metadata":{"name":"nodejs","namespace":"%s","creationTimestamp":null},"spec":{"app":"app","type":"nodejs","sourceType":"local","env":[{"name":"DEBUG_PORT","value":"5858"}]},"status":{"state":"Pushed"}}],"devfileComponents":[]}`, commonVar.Project)
Expect(desiredCompListJSON).Should(MatchJSON(actualCompListJSON))

valuesL := gjson.GetMany(actualCompListJSON, "kind", "s2iComponents.0.metadata.name", "s2iComponents.0.metadata.namespace")
expectedL := []string{"List", "nodejs", commonVar.Project}
Expect(helper.GjsonMatcher(valuesL, expectedL)).To(Equal(true))
helper.CmdShouldPass("odo", "app", "describe", "--project", commonVar.Project)
desiredDesAppJSON := fmt.Sprintf(`{"kind":"Application","apiVersion":"odo.dev/v1alpha1","metadata":{"name":"app","namespace":"%s","creationTimestamp":null},"spec":{"components": ["nodejs"]}}`, commonVar.Project)
actualDesAppJSON := helper.CmdShouldPass("odo", "app", "describe", "app", "-o", "json", "--project", commonVar.Project)
Expect(desiredDesAppJSON).Should(MatchJSON(actualDesAppJSON))
valuesDes := gjson.GetMany(actualDesAppJSON, "kind", "metadata.name", "metadata.namespace")
expectedDes := []string{"Application", "app", commonVar.Project}
Expect(helper.GjsonMatcher(valuesDes, expectedDes)).To(Equal(true))

helper.CmdShouldPass("odo", "app", "delete", "-f", "--project", commonVar.Project)
})
Expand Down Expand Up @@ -97,14 +99,15 @@ var _ = Describe("odo app command tests", func() {
appListOutput := helper.CmdShouldPass("odo", "app", "list", "--project", commonVar.Project)
Expect(appListOutput).To(ContainSubstring(appName))
actualCompListJSON := helper.CmdShouldPass("odo", "app", "list", "-o", "json", "--project", commonVar.Project)
//desiredCompListJSON := `{"kind":"List","apiVersion":"odo.dev/v1alpha1","metadata":{},"items":[]}`
desiredCompListJSON := fmt.Sprintf(`{"kind":"List","apiVersion":"odo.dev/v1alpha1","metadata":{},"items":[{"kind":"Application","apiVersion":"odo.dev/v1alpha1","metadata":{"name":"app","namespace":"%s","creationTimestamp":null},"spec":{"components":["%s"]}}]}`, commonVar.Project, cmpName)
Expect(desiredCompListJSON).Should(MatchJSON(actualCompListJSON))
valuesList := gjson.GetMany(actualCompListJSON, "kind", "items.#.metadata.name", "items.#.metadata.namespace")
expectedList := []string{"List", "app", commonVar.Project}
Expect(helper.GjsonMatcher(valuesList, expectedList)).To(Equal(true))

helper.CmdShouldPass("odo", "app", "describe", appName, "--project", commonVar.Project)
desiredDesAppJSON := fmt.Sprintf(`{"kind":"Application","apiVersion":"odo.dev/v1alpha1","metadata":{"name":"%s","namespace":"%s","creationTimestamp":null},"spec":{"components":["%s"]}}`, appName, commonVar.Project, cmpName)
actualDesAppJSON := helper.CmdShouldPass("odo", "app", "describe", appName, "--project", commonVar.Project, "-o", "json")
Expect(desiredDesAppJSON).Should(MatchJSON(actualDesAppJSON))
valuesDes := gjson.GetMany(actualDesAppJSON, "kind", "metadata.name", "metadata.namespace")
expectedDes := []string{"Application", appName, commonVar.Project}
Expect(helper.GjsonMatcher(valuesDes, expectedDes)).To(Equal(true))

helper.CmdShouldPass("odo", "app", "delete", appName, "--project", commonVar.Project, "-f")
})
Expand Down
8 changes: 5 additions & 3 deletions tests/integration/cmd_pref_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/openshift/odo/tests/helper"
"github.com/tidwall/gjson"
)

var _ = Describe("odo preference and config command tests", func() {
Expand Down Expand Up @@ -95,9 +96,10 @@ var _ = Describe("odo preference and config command tests", func() {
It("should show json output", func() {
prefJSONOutput, err := helper.Unindented(helper.CmdShouldPass("odo", "preference", "view", "-o", "json"))
Expect(err).Should(BeNil())
expected, err := helper.Unindented(`{"kind":"PreferenceList","apiVersion":"odo.dev/v1alpha1","items":[{"Name":"UpdateNotification","Value":null,"Default":true,"Type":"bool","Description":"Flag to control if an update notification is shown or not (Default: true)"},{"Name":"NamePrefix","Value":null,"Default":"","Type":"string","Description":"Use this value to set a default name prefix (Default: current directory name)"},{"Name":"Timeout","Value":null,"Default":1,"Type":"int","Description":"Timeout (in seconds) for OpenShift server connection check (Default: 1)"},{"Name":"BuildTimeout","Value":null,"Default":300,"Type":"int","Description":"BuildTimeout (in seconds) for waiting for a build of the git component to complete (Default: 300)"},{"Name":"PushTimeout","Value":null,"Default":240,"Type":"int","Description":"PushTimeout (in seconds) for waiting for a Pod to come up (Default: 240)"},{"Name":"Experimental","Value":null,"Default":false,"Type":"bool","Description":"Set this value to true to expose features in development/experimental mode"},{"Name":"PushTarget","Value":null,"Default":"kube","Type":"string","Description":"Set this value to 'kube' or 'docker' to tell odo where to push applications to. (Default: kube)"}]}`)
Expect(err).Should(BeNil())
Expect(prefJSONOutput).Should(MatchJSON(expected))
values := gjson.GetMany(prefJSONOutput, "kind", "items.0.Description")
expected := []string{"PreferenceList", "Flag to control if an update notification is shown or not (Default: true)"}
Expect(helper.GjsonMatcher(values, expected)).To(Equal(true))

})

})
Expand Down
20 changes: 13 additions & 7 deletions tests/integration/cmd_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/openshift/odo/tests/helper"
"github.com/tidwall/gjson"
)

var _ = Describe("odo storage command tests", func() {
Expand Down Expand Up @@ -33,16 +34,17 @@ var _ = Describe("odo storage command tests", func() {

Context("when running storage command without required flag(s)", func() {
It("should fail", func() {
requiredFlags := []string{"size", "path", "required"}
requiredFlags := []string{"size", "path"}
helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context)
helper.CmdShouldPass("odo", "component", "create", "--s2i", "nodejs", "nodejs", "--app", "nodeapp", "--project", commonVar.Project, "--context", commonVar.Context)
stdErr := helper.CmdShouldFail("odo", "storage", "create", "pv1", "--size", "1Gi", "--context", commonVar.Context)
helper.MatchAllInOutput(stdErr, requiredFlags)

requiredFlagsS := []string{"size"}
stdErr = helper.CmdShouldFail("odo", "storage", "create", "pv1", "--path", "/data", "--context", commonVar.Context)
helper.MatchAllInOutput(stdErr, requiredFlags)
helper.MatchAllInOutput(stdErr, requiredFlagsS)
stdErr = helper.CmdShouldFail("odo", "storage", "create", "pv1", "--context", commonVar.Context)
helper.MatchAllInOutput(stdErr, requiredFlags)
//helper.CmdShouldFail("odo", "storage", "create", "pv1", "-o", "json")
})
})

Expand Down Expand Up @@ -126,12 +128,16 @@ var _ = Describe("odo storage command tests", func() {
helper.CopyExample(filepath.Join("source", "wildfly"), commonVar.Context)
helper.CmdShouldPass("odo", "component", "create", "--s2i", "wildfly", "wildfly", "--app", "wildflyapp", "--project", commonVar.Project, "--context", commonVar.Context)
actualJSONStorage := helper.CmdShouldPass("odo", "storage", "create", "mystorage", "--path=/opt/app-root/src/storage/", "--size=1Gi", "--context", commonVar.Context, "-o", "json")
desiredJSONStorage := `{"kind":"storage","apiVersion":"odo.dev/v1alpha1","metadata":{"name":"mystorage","creationTimestamp":null},"spec":{"size":"1Gi","path":"/opt/app-root/src/storage/"}}`
Expect(desiredJSONStorage).Should(MatchJSON(actualJSONStorage))

valuesStoreC := gjson.GetMany(actualJSONStorage, "kind", "metadata.name", "spec.size", "spec.path")
expectedStoreC := []string{"storage", "mystorage", "1Gi", "/opt/app-root/src/storage/"}
Expect(helper.GjsonMatcher(valuesStoreC, expectedStoreC)).To(Equal(true))

actualStorageList := helper.CmdShouldPass("odo", "storage", "list", "--context", commonVar.Context, "-o", "json")
desiredStorageList := `{"kind":"List","apiVersion":"odo.dev/v1alpha1","metadata":{},"items":[{"kind":"storage","apiVersion":"odo.dev/v1alpha1","metadata":{"name":"mystorage","creationTimestamp":null},"spec":{"size":"1Gi","path":"/opt/app-root/src/storage/"},"status":"Not Pushed"}]}`
Expect(desiredStorageList).Should(MatchJSON(actualStorageList))

valuesStoreL := gjson.GetMany(actualStorageList, "kind", "items.0.kind", "items.0.metadata.name", "items.0.spec.size")
expectedStoreL := []string{"List", "storage", "mystorage", "1Gi"}
Expect(helper.GjsonMatcher(valuesStoreL, expectedStoreL)).To(Equal(true))

helper.CmdShouldPass("odo", "storage", "delete", "mystorage", "--context", commonVar.Context, "-f")
})
Expand Down
Loading

0 comments on commit 14c98ec

Please sign in to comment.