Skip to content

Commit bdc0d75

Browse files
Merge pull request #1121 from kuiwang02/opm
OCPQE-30741: support opm cases
2 parents 2c539ec + e2870c7 commit bdc0d75

File tree

87 files changed

+19901
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+19901
-65
lines changed

tests-extension/.openshift-tests-extension/openshift_payload_olmv0.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,35 @@
179179
"source": "openshift:payload:olmv0",
180180
"lifecycle": "informing",
181181
"environmentSelector": {}
182+
},
183+
{
184+
"name": "[sig-operator][Jira:OLM] OLMv0 opm should PolarionID:43185-DC based opm subcommands out of alpha",
185+
"labels": {
186+
"Extended": {},
187+
"NonHyperShiftHOST": {}
188+
},
189+
"resources": {
190+
"isolation": {}
191+
},
192+
"source": "openshift:payload:olmv0",
193+
"lifecycle": "informing",
194+
"environmentSelector": {
195+
"exclude": "topology==\"External\""
196+
}
197+
},
198+
{
199+
"name": "[sig-operator][Jira:OLM] OLMv0 opm should PolarionID:43180-opm init dc configuration package",
200+
"labels": {
201+
"Extended": {},
202+
"NonHyperShiftHOST": {}
203+
},
204+
"resources": {
205+
"isolation": {}
206+
},
207+
"source": "openshift:payload:olmv0",
208+
"lifecycle": "informing",
209+
"environmentSelector": {
210+
"exclude": "topology==\"External\""
211+
}
182212
}
183213
]

tests-extension/cmd/main.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,30 @@ func main() {
286286
Long: "OLMv0 Tests Extension",
287287
}
288288

289-
root.AddCommand(cmd.DefaultExtensionCommands(registry)...)
289+
// Get all default commands from the extension framework
290+
allCommands := cmd.DefaultExtensionCommands(registry)
291+
292+
// Add KUBECONFIG check to run-suite and run-test commands only.
293+
// Other commands (list, info, images, update, completion, help) don't need KUBECONFIG.
294+
for _, command := range allCommands {
295+
// Identify run-suite and run-test commands by their Use field
296+
if command.Use == "run-suite NAME" || command.Use == "run-test [-n NAME...] [NAME]" {
297+
// Save the original RunE function
298+
originalRunE := command.RunE
299+
300+
// Wrap it with KUBECONFIG check
301+
command.RunE = func(cmd *cobra.Command, args []string) error {
302+
// Check KUBECONFIG before running the test
303+
if err := exutil.CheckKubeconfigSet(); err != nil {
304+
return err
305+
}
306+
// Call the original RunE function
307+
return originalRunE(cmd, args)
308+
}
309+
}
310+
}
311+
312+
root.AddCommand(allCommands...)
290313

291314
if err := func() error {
292315
return root.Execute()

0 commit comments

Comments
 (0)