@@ -161,60 +161,72 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
161
161
})
162
162
163
163
ginkgo .It ("/v2index/all endpoint should return stacks and samples" , func () {
164
- registryIndex := util .GetRegistryIndex (config .Registry + "/v2index/all" )
165
-
166
- hasStacks := false
167
- hasSamples := false
168
- for _ , index := range registryIndex {
169
- if index .Type == indexSchema .SampleDevfileType {
170
- hasSamples = true
171
- }
172
- if index .Type == indexSchema .StackDevfileType {
173
- hasStacks = true
164
+ if config .IsTestRegistry {
165
+ registryIndex := util .GetRegistryIndex (config .Registry + "/v2index/all" )
166
+
167
+ hasStacks := false
168
+ hasSamples := false
169
+ for _ , index := range registryIndex {
170
+ if index .Type == indexSchema .SampleDevfileType {
171
+ hasSamples = true
172
+ }
173
+ if index .Type == indexSchema .StackDevfileType {
174
+ hasStacks = true
175
+ }
174
176
}
177
+ gomega .Expect (hasStacks && hasSamples ).To (gomega .BeTrue ())
178
+ } else {
179
+ ginkgo .Skip ("cannot guarantee test outside of test registry, skipping test" )
175
180
}
176
- gomega .Expect (hasStacks && hasSamples ).To (gomega .BeTrue ())
177
181
})
178
182
179
183
ginkgo .It ("/v2index/all?icon=base64 endpoint should return stacks and samples with encoded icon" , func () {
180
- registryIndex := util .GetRegistryIndex (config .Registry + "/v2index/all?icon=base64" )
184
+ if config .IsTestRegistry {
185
+ registryIndex := util .GetRegistryIndex (config .Registry + "/v2index/all?icon=base64" )
181
186
182
- hasStacks := false
183
- hasSamples := false
187
+ hasStacks := false
188
+ hasSamples := false
184
189
185
- for _ , index := range registryIndex {
186
- if index .Type == indexSchema .SampleDevfileType {
187
- hasSamples = true
188
- }
189
- if index .Type == indexSchema .StackDevfileType {
190
- hasStacks = true
191
- }
192
- if index .Icon != "" {
193
- gomega .Expect (index .Icon ).To (gomega .HavePrefix ("data:image" ))
190
+ for _ , index := range registryIndex {
191
+ if index .Type == indexSchema .SampleDevfileType {
192
+ hasSamples = true
193
+ }
194
+ if index .Type == indexSchema .StackDevfileType {
195
+ hasStacks = true
196
+ }
197
+ if index .Icon != "" {
198
+ gomega .Expect (index .Icon ).To (gomega .HavePrefix ("data:image" ))
199
+ }
194
200
}
201
+ gomega .Expect (hasStacks && hasSamples ).To (gomega .BeTrue ())
202
+ } else {
203
+ ginkgo .Skip ("cannot guarantee test outside of test registry, skipping test" )
195
204
}
196
- gomega .Expect (hasStacks && hasSamples ).To (gomega .BeTrue ())
197
205
})
198
206
199
207
ginkgo .It ("/v2index/all?arch=amd64&arch=arm64 endpoint should return stacks and samples for arch amd64 and arm64" , func () {
200
- registryIndex := util .GetRegistryIndex (config .Registry + "/v2index/all?arch=amd64&arch=arm64" )
201
-
202
- hasStacks := false
203
- hasSamples := false
204
- for _ , index := range registryIndex {
205
- if index .Type == indexSchema .SampleDevfileType {
206
- hasSamples = true
207
- }
208
- if index .Type == indexSchema .StackDevfileType {
209
- hasStacks = true
210
- }
211
- if len (index .Architectures ) != 0 {
212
- gomega .Expect (index .Architectures ).Should (gomega .ContainElements ("amd64" , "arm64" ))
208
+ if config .IsTestRegistry {
209
+ registryIndex := util .GetRegistryIndex (config .Registry + "/v2index/all?arch=amd64&arch=arm64" )
210
+
211
+ hasStacks := false
212
+ hasSamples := false
213
+ for _ , index := range registryIndex {
214
+ if index .Type == indexSchema .SampleDevfileType {
215
+ hasSamples = true
216
+ }
217
+ if index .Type == indexSchema .StackDevfileType {
218
+ hasStacks = true
219
+ }
220
+ if len (index .Architectures ) != 0 {
221
+ gomega .Expect (index .Architectures ).Should (gomega .ContainElements ("amd64" , "arm64" ))
222
+ }
213
223
}
214
- }
215
224
216
- if len (registryIndex ) > 0 {
217
- gomega .Expect (hasStacks && hasSamples ).To (gomega .BeTrue ())
225
+ if len (registryIndex ) > 0 {
226
+ gomega .Expect (hasStacks && hasSamples ).To (gomega .BeTrue ())
227
+ }
228
+ } else {
229
+ ginkgo .Skip ("cannot guarantee test outside of test registry, skipping test" )
218
230
}
219
231
})
220
232
@@ -223,7 +235,7 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
223
235
224
236
for _ , index := range registryIndex {
225
237
if len (index .Versions ) != 0 {
226
- for _ , version := range index .Versions {
238
+ for _ , version := range index .Versions {
227
239
gomega .Expect (version .SchemaVersion ).Should (gomega .HavePrefix ("2.1" ))
228
240
}
229
241
}
@@ -261,10 +273,14 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
261
273
})
262
274
263
275
ginkgo .It ("/devfiles/<devfile>/<version> endpoint should return a devfile for samples" , func () {
264
- parserArgs := parser.ParserArgs {
265
- URL : config .Registry + "/devfiles/code-with-quarkus/latest" ,
276
+ if config .IsTestRegistry {
277
+ parserArgs := parser.ParserArgs {
278
+ URL : config .Registry + "/devfiles/code-with-quarkus/latest" ,
279
+ }
280
+ _ , _ , err := devfilePkg .ParseDevfileAndValidate (parserArgs )
281
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
282
+ } else {
283
+ ginkgo .Skip ("cannot guarantee test outside of test registry, skipping test" )
266
284
}
267
- _ , _ , err := devfilePkg .ParseDevfileAndValidate (parserArgs )
268
- gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
269
285
})
270
286
})
0 commit comments