Skip to content
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

Add cluster as callback to fixture cluster #2340

Closed
wants to merge 2 commits into from

Conversation

bkopilov
Copy link
Contributor

Current cluster fixture when called create and register the cluster, We can not modify / update params dynamically when creating cluster

In some cases we may want to get cluster object and before it registerd send params/verify as openshit_version , pull keys and more. example for use case: a test try to send to "register" cluster missing params or ask for custom ocp version based on dynamic configuration.

The idea here allow to user decide on cluster fixture if its a registered cluster object or callback_cluster.
In case its a callback cluster we call callback_cluster() and the object created and registered. The callback_cluster is object that has reference to param from cluster fixtube and will allow to change configuration .

Example for testcase:
class TestProxy(BaseTest):

callback_cluster = True

def test_benny(self):
	supported_versions = cluster.api_client.versions.v2_list_supported_openshift_versions()
cluster1 = cluster()
    cluster1.prepare_for_installation()

with this support we will be able to gain the cleanup that cluster fixture has.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 21, 2023
@openshift-ci openshift-ci bot requested review from rccrdpccl and tsorya December 21, 2023 09:57
Copy link

openshift-ci bot commented Dec 21, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bkopilov
Once this PR has been reviewed and has the lgtm label, please assign omertuc for approval. For more information see the Kubernetes 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

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 21, 2023
Copy link

openshift-ci bot commented Dec 21, 2023

Hi @bkopilov. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

Current cluster fixture when called create and register the cluster,
We can not modify / update params dynamically when creating cluster

In some cases we may want to get cluster object and before it registerd
send params/verify as openshit_version , pull keys and more.
example for use case: a test try to send to "register" cluster missing params
or ask for custom ocp version based on dynamic configuration.

The idea here allow to user decide on cluster fixture if its a registered cluster object
or callback_cluster.
In case its a callback cluster we call callback_cluster() and the object created and registered.
The callback_cluster is object that has reference to param from cluster fixtube and will allow to
change configuration .

Example for testcase:
class TestProxy(BaseTest):

    callback_cluster = True

    def test_benny(self):
    	supported_versions = cluster.api_client.versions.v2_list_supported_openshift_versions()
 	cluster1 = cluster()
        cluster1.prepare_for_installation()

with this support we will be able to gain the cleanup that cluster fixture has.
@bkopilov bkopilov force-pushed the create_callback_cluster branch from e054a63 to 39098cc Compare December 21, 2023 09:59
@bkopilov
Copy link
Contributor Author

@lalon4 , @adriengentil , @danmanor

This patch to address custom ocp tests ... let me know what do you think.
I know its a little bit overhead but it will allow us to extend tests

@rccrdpccl
Copy link
Contributor

@bkopilov is this still needed?

/cc @adriengentil @eifrach

@rccrdpccl
Copy link
Contributor

/uncc @rccrdpccl

@openshift-ci openshift-ci bot removed the request for review from rccrdpccl February 15, 2024 13:36
@rccrdpccl
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 15, 2024
Copy link

openshift-ci bot commented Feb 15, 2024

@bkopilov: all tests passed!

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/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 16, 2024
@bkopilov
Copy link
Contributor Author

/close.

@bkopilov
Copy link
Contributor Author

/close

@bkopilov bkopilov closed this May 16, 2024
@bkopilov
Copy link
Contributor Author

Not needed

Copy link

openshift-ci bot commented May 16, 2024

@bkopilov: Closed this PR.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants