Skip to content

Add default MC validation tests to upgrade#583

Merged
dbasunag merged 19 commits intoopendatahub-io:mainfrom
dbasunag:upgrade_mc
Sep 5, 2025
Merged

Add default MC validation tests to upgrade#583
dbasunag merged 19 commits intoopendatahub-io:mainfrom
dbasunag:upgrade_mc

Conversation

@dbasunag
Copy link
Copy Markdown
Collaborator

@dbasunag dbasunag commented Sep 4, 2025

Description

How Has This Been Tested?

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

Summary by CodeRabbit

  • Tests
    • Expanded post-upgrade test coverage by marking relevant scenarios to run after upgrades.
    • Strengthened default catalog validations with additional assertions for identity and naming.
    • Simplified test teardown by removing redundant manual cleanup, reducing flakiness and runtime overhead.
    • Minor test refactors to streamline setup and dependencies.

@dbasunag dbasunag requested review from fege and lugi0 as code owners September 4, 2025 18:43
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 4, 2025

📝 Walkthrough

Walkthrough

Removed manual ConfigMap cleanup utility and its usages in fixtures. Updated default model catalog tests to import constants, mark two tests as post-upgrade, and add assertions for default catalog id and name. No public API changes beyond deleting an internal utility function.

Changes

Cohort / File(s) Summary of changes
Fixture cleanup removal
tests/model_registry/conftest.py, tests/model_registry/rbac/conftest.py
Removed imports and teardown calls to delete the model catalog ConfigMap; eliminated dependency on delete utility and related config import; fixture logic otherwise unchanged.
Default catalog tests adjustments
tests/model_registry/model_catalog/test_default_model_catalog.py
Added imports for DEFAULT_CATALOG_ID and DEFAULT_CATALOG_NAME; marked two tests with @pytest.mark.post_upgrade; added assertions validating default catalog id and name.
Utils cleanup
tests/model_registry/utils.py
Removed DEFAULT_MODEL_CATALOG import; deleted delete_model_catalog_configmap function; retained get_model_catalog_pod.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/model_registry/model_catalog/test_default_model_catalog.py (1)

85-86: DRY: reuse the existing helper to validate the default catalog.

You already import validate_default_catalog; use it here to keep the checks consistent with Line 37.

Apply:

-        assert result[0]["id"] == DEFAULT_CATALOG_ID
-        assert result[0]["name"] == DEFAULT_CATALOG_NAME
+        validate_default_catalog(default_catalog=result[0])
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dcff182 and b6dd983.

📒 Files selected for processing (4)
  • tests/model_registry/conftest.py (0 hunks)
  • tests/model_registry/model_catalog/test_default_model_catalog.py (4 hunks)
  • tests/model_registry/rbac/conftest.py (0 hunks)
  • tests/model_registry/utils.py (0 hunks)
💤 Files with no reviewable changes (3)
  • tests/model_registry/conftest.py
  • tests/model_registry/rbac/conftest.py
  • tests/model_registry/utils.py
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: lugi0
PR: opendatahub-io/opendatahub-tests#487
File: tests/model_registry/async_job/constants.py:23-31
Timestamp: 2025-08-08T15:58:03.524Z
Learning: In opendatahub-io/opendatahub-tests, for tests under tests/model_registry/async_job (e.g., constants.py and related fixtures), runs start from a clean, known Model Registry state. Therefore, using static MODEL_ID, MODEL_VERSION_ID, and MODEL_ARTIFACT_ID values in MODEL_SYNC_CONFIG is intentional and acceptable; dynamic ID injection is not required for these async job tests (per guidance from user lugi0).
Learnt from: lugi0
PR: opendatahub-io/opendatahub-tests#446
File: tests/model_registry/conftest.py:733-770
Timestamp: 2025-07-17T15:42:23.880Z
Learning: In tests/model_registry/conftest.py, the model_registry_instance_1 and model_registry_instance_2 fixtures do not need explicit database dependency fixtures (like db_deployment_1, db_secret_1, etc.) in their function signatures. Pytest's dependency injection automatically handles the fixture dependencies when they reference db_name_1 and db_name_2 parameters. This is the correct pattern for these Model Registry instance fixtures.
📚 Learning: 2025-08-08T15:58:03.524Z
Learnt from: lugi0
PR: opendatahub-io/opendatahub-tests#487
File: tests/model_registry/async_job/constants.py:23-31
Timestamp: 2025-08-08T15:58:03.524Z
Learning: In opendatahub-io/opendatahub-tests, for tests under tests/model_registry/async_job (e.g., constants.py and related fixtures), runs start from a clean, known Model Registry state. Therefore, using static MODEL_ID, MODEL_VERSION_ID, and MODEL_ARTIFACT_ID values in MODEL_SYNC_CONFIG is intentional and acceptable; dynamic ID injection is not required for these async job tests (per guidance from user lugi0).

Applied to files:

  • tests/model_registry/model_catalog/test_default_model_catalog.py
📚 Learning: 2025-08-21T19:08:14.982Z
Learnt from: dbasunag
PR: opendatahub-io/opendatahub-tests#527
File: tests/model_registry/rbac/conftest.py:358-359
Timestamp: 2025-08-21T19:08:14.982Z
Learning: In tests/model_registry/rbac/conftest.py, the model catalog configmap only exists in one specific namespace (py_config["model_registry_namespace"]) regardless of where model registry instances are deployed, making it a shared resource that serves all model registry instances across namespaces.

Applied to files:

  • tests/model_registry/model_catalog/test_default_model_catalog.py
🔇 Additional comments (3)
tests/model_registry/model_catalog/test_default_model_catalog.py (3)

13-13: Good move: centralize “default catalog” expectations via constants.

Eliminates magic strings/IDs in tests and keeps expectations aligned across suites.


29-37: Ensure post_upgrade marker is registered and used in CI selection.

Register the marker in pytest.ini to avoid PytestUnknownMarkWarning and wire it into the upgrade job select expression.

If missing, add:

+# pytest.ini
+[pytest]
+markers =
+    post_upgrade: Run only after cluster upgrade completes.

60-66: Same as above for post_upgrade on parametrized resource test.

Confirm the marker is declared and that your CI runs -m post_upgrade in the upgrade stage.

@github-actions github-actions bot added the size/s label Sep 4, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 4, 2025

The following are automatically added/executed:

  • PR size label.
  • Run pre-commit
  • Run tox
  • Add PR author as the PR assignee
  • Build image based on the PR

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.
  • To Cherry-pick a merged PR /cherry-pick <target_branch_name> to the PR. If <target_branch_name> is valid,
    and the current PR is merged, a cherry-picked PR would be created and linked to the current PR.
  • To build and push image to quay, add /build-push-pr-image in a comment. This would create an image with tag
    pr-<pr_number> to quay repository. This image tag, however would be deleted on PR merge or close action.
Supported labels

{'/hold', '/cherry-pick', '/lgtm', '/build-push-pr-image', '/verified', '/wip'}

Copy link
Copy Markdown
Contributor

@fege fege left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Copy Markdown
Contributor

@sheltoncyril sheltoncyril left a comment

Choose a reason for hiding this comment

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

/lgtm

@dbasunag dbasunag merged commit 6fb715d into opendatahub-io:main Sep 5, 2025
9 checks passed
@dbasunag dbasunag deleted the upgrade_mc branch September 5, 2025 13:06
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 5, 2025

Status of building tag latest: success.
Status of pushing tag latest to image registry: success.

mwaykole pushed a commit to mwaykole/opendatahub-tests that referenced this pull request Jan 23, 2026
* on rebase clean commented-by- labels

* Add default MC validation tests to upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants