Skip to content

WIP OPRUN-4054: [OTE] add catalog tests from openshift/origin #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Aug 1, 2025

This commit migrates the olmv1_catalog set of tests from openshift/origin
to OTE as part the broad effort to migrate all tests.

@openshift-ci openshift-ci bot requested review from grokspawn and tmshort August 1, 2025 10:13
Copy link
Contributor

openshift-ci bot commented Aug 1, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: camilamacedo86
Once this PR has been reviewed and has the lgtm label, please assign tmshort for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@camilamacedo86 camilamacedo86 force-pushed the add-catalog-tests-only-ote branch 3 times, most recently from 544842d to 5ac974e Compare August 1, 2025 11:00
@camilamacedo86
Copy link
Contributor Author

/retest-required

@camilamacedo86 camilamacedo86 changed the title [OTE] add catalog tests from openshift/origin OPRUN-4054: [OTE] add catalog tests from openshift/origin Aug 4, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 4, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 4, 2025

@camilamacedo86: This pull request references OPRUN-4054 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set.

In response to this:

Summary of Changes

This PR migrates the OLMv1 catalog tests from openshift/origin/test/extended/olm/olmv1-catalogd.go to the OpenShift Test Extension (OTE) framework. The new implementation replaces the use of the oc command-line interface with a Go-native, strongly-typed client, and leverages the OLM API directly for resource management.

The migration offers several key improvements:

  • Go-native API Interaction: Replaces oc command executions and manual JSON parsing with direct calls to the Kubernetes API using the controller-runtime client. This provides a more robust, type-safe, and efficient way to interact with cluster resources.
  • Programmatic Resource Management: Instead of relying on testdata YAML files, test resources like ClusterCatalog and Job objects are now created and managed programmatically using Go structs. This eliminates the need for temporary files and enhances test reliability.
  • Improved Polling and Assertions: Switches from manual polling loops (wait.PollUntilContextTimeout) and output parsing to declarative gomega.Eventually blocks. This makes the tests more readable and less fragile when verifying asynchronous state changes.

This change aligns the OLMv1 tests with modern Go testing practices, improves maintainability, and removes the dependency on the oc CLI for test execution.

Comparison of Methodologies

Feature Original Test (openshift/origin) New OTE Test (operator-controller/openshift)
Kubernetes Interaction oc CLI commands (oc get, oc apply) with manual JSON output parsing. Go client (controller-runtime) for direct, type-safe API calls.
Resource Creation Manually writing and applying YAML files from a testdata directory. Programmatic creation of Go structs (e.g., olmv1.ClusterCatalog).
Resource Cleanup Relies on AfterEach blocks with oc delete commands on temporary files. Uses ginkgo.DeferCleanup for a more robust and idiomatic cleanup mechanism.
Asynchronous State Checks wait.PollUntilContextTimeout function with manual logic to parse and check status conditions from oc output. gomega.Eventually with typed assertions against native Go objects.
Dependency Requires the oc CLI to be installed and available in the test environment. No dependency on external CLI tools. Relies solely on the Go test binary and a valid kubeconfig.

--- **Disclaimer:** This summary and comparison was generated by an AI assistant.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@camilamacedo86 camilamacedo86 changed the title OPRUN-4054: [OTE] add catalog tests from openshift/origin WIP OPRUN-4054: [OTE] add catalog tests from openshift/origin Aug 6, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 6, 2025
@camilamacedo86 camilamacedo86 force-pushed the add-catalog-tests-only-ote branch 5 times, most recently from d7f6181 to be4f081 Compare August 8, 2025 19:43
This commit migrates the olmv1_catalog set of tests from openshift/origin
to OTE as part the broad effort to migrate all tests.

Assisted-by: Gemini
@camilamacedo86 camilamacedo86 force-pushed the add-catalog-tests-only-ote branch from be4f081 to 0e7e9e0 Compare August 8, 2025 22:02
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 8, 2025

@camilamacedo86: This pull request references OPRUN-4054 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set.

In response to this:

This commit migrates the olmv1_catalog set of tests from openshift/origin
to OTE as part the broad effort to migrate all tests.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@@ -1,4 +1,104 @@
[
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 Catalogs should be installed",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 openshift-community-operators Catalog should serve FBC via the /v1/api/all endpoint",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 openshift-certified-operators Catalog should serve FBC via the /v1/api/all endpoint",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 openshift-redhat-marketplace Catalog should serve FBC via the /v1/api/all endpoint",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 openshift-redhat-operators Catalog should serve FBC via the /v1/api/all endpoint",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLMCatalogdAPIV1Metas][Skipped:Disconnected] OLMv1 openshift-community-operators Catalog should serve FBC via the /v1/api/metas endpoint",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLMCatalogdAPIV1Metas][Skipped:Disconnected] OLMv1 openshift-certified-operators Catalog should serve FBC via the /v1/api/metas endpoint",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLMCatalogdAPIV1Metas][Skipped:Disconnected] OLMv1 openshift-redhat-marketplace Catalog should serve FBC via the /v1/api/metas endpoint",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLMCatalogdAPIV1Metas][Skipped:Disconnected] OLMv1 openshift-redhat-operators Catalog should serve FBC via the /v1/api/metas endpoint",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 New Catalog Install should fail to install if it has an invalid reference",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camilamacedo86
Copy link
Contributor Author

/test e2e-aws-techpreview-olmv1-ext

@camilamacedo86
Copy link
Contributor Author

/test openshift-e2e-aws

Copy link
Contributor

openshift-ci bot commented Aug 9, 2025

@camilamacedo86: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/openshift-e2e-aws 0e7e9e0 link true /test openshift-e2e-aws
ci/prow/okd-scos-e2e-aws-ovn 0e7e9e0 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-aws-techpreview-olmv1-ext 0e7e9e0 link true /test e2e-aws-techpreview-olmv1-ext
ci/prow/openshift-e2e-aws-techpreview 0e7e9e0 link false /test openshift-e2e-aws-techpreview

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants