assisted-test-infra icon indicating copy to clipboard operation
assisted-test-infra copied to clipboard

Add cluster as callback to fixture cluster

Open bkopilov opened this issue 1 year ago • 7 comments

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 avatar Dec 21 '23 09:12 bkopilov

[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[bot] avatar Dec 21 '23 09:12 openshift-ci[bot]

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.

openshift-ci[bot] avatar Dec 21 '23 09:12 openshift-ci[bot]

@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

bkopilov avatar Dec 21 '23 10:12 bkopilov

@bkopilov is this still needed?

/cc @adriengentil @eifrach

rccrdpccl avatar Feb 15 '24 13:02 rccrdpccl

/uncc @rccrdpccl

rccrdpccl avatar Feb 15 '24 13:02 rccrdpccl

/ok-to-test

rccrdpccl avatar Feb 15 '24 13:02 rccrdpccl

@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-ci[bot] avatar Feb 15 '24 15:02 openshift-ci[bot]

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-bot avatar May 16 '24 01:05 openshift-bot

/close.

bkopilov avatar May 16 '24 05:05 bkopilov

/close

bkopilov avatar May 16 '24 09:05 bkopilov

Not needed

bkopilov avatar May 16 '24 09:05 bkopilov

@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.

openshift-ci[bot] avatar May 16 '24 09:05 openshift-ci[bot]