@@ -3,6 +3,7 @@ package integration
3
3
import (
4
4
. "github.com/onsi/ginkgo/v2"
5
5
. "github.com/onsi/gomega"
6
+
6
7
"github.com/redhat-developer/odo/tests/helper"
7
8
)
8
9
@@ -141,24 +142,34 @@ var _ = Describe("odo generic", func() {
141
142
serverURL := oc .GetCurrentServerURL ()
142
143
Expect (odoVersion ).Should (ContainSubstring ("Server: " + serverURL ))
143
144
if ! helper .IsKubernetesCluster () {
144
- Expect (odoVersion ).Should (ContainSubstring ("OpenShift: " ))
145
+ ocpMatcher := ContainSubstring ("OpenShift: " )
146
+ if serverVersion := commonVar .CliRunner .GetVersion (); serverVersion == "" {
147
+ // Might indicate a user permission error on certain clusters (observed with a developer account on Prow nightly jobs)
148
+ ocpMatcher = Not (ocpMatcher )
149
+ }
150
+ Expect (odoVersion ).Should (ocpMatcher )
145
151
}
146
152
}
147
153
})
148
154
149
155
By ("checking the JSON output" , func () {
150
156
odoVersion = helper .Cmd ("odo" , "version" , "-o" , "json" ).ShouldPass ().Out ()
151
157
Expect (helper .IsJSON (odoVersion )).To (BeTrue ())
152
- helper .JsonPathSatisfies (odoVersion , "version" , MatchRegexp (reJSONVersion ))
158
+ helper .JsonPathSatisfiesAll (odoVersion , "version" , MatchRegexp (reJSONVersion ))
153
159
helper .JsonPathExist (odoVersion , "gitCommit" )
154
160
if podman {
155
- helper .JsonPathSatisfies (odoVersion , "podman.client.version" , MatchRegexp (reJSONVersion ), Equal (helper .GetPodmanVersion ()))
161
+ helper .JsonPathSatisfiesAll (odoVersion , "podman.client.version" , MatchRegexp (reJSONVersion ), Equal (helper .GetPodmanVersion ()))
156
162
} else {
157
- helper .JsonPathSatisfies (odoVersion , "cluster.kubernetes.version" , MatchRegexp (reJSONVersion ))
163
+ helper .JsonPathSatisfiesAll (odoVersion , "cluster.kubernetes.version" , MatchRegexp (reJSONVersion ))
158
164
serverURL := oc .GetCurrentServerURL ()
159
165
helper .JsonPathContentIs (odoVersion , "cluster.serverURL" , serverURL )
160
166
if ! helper .IsKubernetesCluster () {
161
- helper .JsonPathSatisfies (odoVersion , "cluster.openshift" , Not (BeEmpty ()))
167
+ m := BeEmpty ()
168
+ if serverVersion := commonVar .CliRunner .GetVersion (); serverVersion != "" {
169
+ // A blank serverVersion might indicate a user permission error on certain clusters (observed with a developer account on Prow nightly jobs)
170
+ m = Not (m )
171
+ }
172
+ helper .JsonPathSatisfiesAll (odoVersion , "cluster.openshift" , m )
162
173
}
163
174
}
164
175
})
@@ -194,10 +205,10 @@ var _ = Describe("odo generic", func() {
194
205
By ("checking JSON output" , func () {
195
206
odoVersion := helper .Cmd ("odo" , "version" , "--client" , "-o" , "json" ).ShouldPass ().Out ()
196
207
Expect (helper .IsJSON (odoVersion )).To (BeTrue ())
197
- helper .JsonPathSatisfies (odoVersion , "version" , MatchRegexp (reJSONVersion ))
208
+ helper .JsonPathSatisfiesAll (odoVersion , "version" , MatchRegexp (reJSONVersion ))
198
209
helper .JsonPathExist (odoVersion , "gitCommit" )
199
- helper .JsonPathSatisfies (odoVersion , "cluster" , BeEmpty ())
200
- helper .JsonPathSatisfies (odoVersion , "podman" , BeEmpty ())
210
+ helper .JsonPathSatisfiesAll (odoVersion , "cluster" , BeEmpty ())
211
+ helper .JsonPathSatisfiesAll (odoVersion , "podman" , BeEmpty ())
201
212
})
202
213
})
203
214
})
0 commit comments