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 fixture to set managementState for components #99

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

lugi0
Copy link
Collaborator

@lugi0 lugi0 commented Jan 22, 2025

Description

Added two fixtures, one to get the DSC resource in the cluster which is run in a session scope and the other to patch the managementState of a given component to the desired state with ResourceEditor, which will revert the change after the fixture call is done.
For now it has been set with scope "module", assuming that a given component needs to be modified for the whole test module.
There is an accompanying helper function that gets the current state of a component, to avoid a useless patch if the desired state is the one already set in the DSC.
Small improvement to the "test_model_registry_creation" test module to enable the MR component if currently set to Removed (default behaviour while the component is in Tech Preview)

How Has This Been Tested?

Tested running the model registry creation test with the component state set to both Managed and Removed beforehand

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@lugi0 lugi0 added the Verified Verified pr in Jenkins label Jan 22, 2025
@lugi0 lugi0 self-assigned this Jan 22, 2025
Copy link

The following are automatically added/executed:

Available user actions:

  • To mark a PR as WIP, add /wip in a comment. To remove it from the PR comment /wip cancel to the PR.
  • To block merging of a PR, add /hold in a comment. To un-block merging of PR comment /hold cancel.
  • To mark a PR as approved, add /lgtm in a comment. To remove, add /lgtm cancel.
    lgtm label removed on each new commit push.
  • To mark PR as verified comment /verified to the PR, to un-verify comment /verified cancel to the PR.
    verified label removed on each new commit push.
Supported labels

{'/wip', '/verified', '/lgtm', '/hold'}

@github-actions github-actions bot removed the Verified Verified pr in Jenkins label Jan 22, 2025
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/model_registry/test_model_registry_creation.py Outdated Show resolved Hide resolved
Signed-off-by: lugi0 <[email protected]>
@lugi0 lugi0 requested a review from rnetser January 23, 2025 14:44
@github-actions github-actions bot added size/m and removed size/s labels Jan 23, 2025
tests/conftest.py Outdated Show resolved Hide resolved
@lugi0 lugi0 requested a review from rnetser January 24, 2025 09:19
@rnetser rnetser merged commit 5e0f771 into opendatahub-io:main Jan 24, 2025
4 checks passed
mwaykole pushed a commit to mwaykole/opendatahub-tests that referenced this pull request Jan 29, 2025
* Add fixture to set managementState for components

Signed-off-by: lugi0 <[email protected]>

* Address PR comments

Signed-off-by: lugi0 <[email protected]>

* return dsc instead of yield

Signed-off-by: lugi0 <[email protected]>

---------

Signed-off-by: lugi0 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants