Skip to content

Remove enabled_model_catalog_config_map fixture and it's usage#1002

Merged
dbasunag merged 8 commits intoopendatahub-io:mainfrom
dbasunag:remove_enabled_catalog_fixture
Jan 12, 2026
Merged

Remove enabled_model_catalog_config_map fixture and it's usage#1002
dbasunag merged 8 commits intoopendatahub-io:mainfrom
dbasunag:remove_enabled_catalog_fixture

Conversation

@dbasunag
Copy link
Copy Markdown
Collaborator

@dbasunag dbasunag commented Jan 9, 2026

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
    • Simplified many test suites by removing an unused fixture from numerous test signatures and parametrizations; a small number of tests/modules were marked skipped.
  • Chores
    • Removed unused test utilities and imports; eliminated dynamic endpoint discovery helper and related overhead.
  • Behavioral tweaks
    • Default test catalog entries now include explicit "enabled" flags.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 9, 2026

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

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 9, 2026

📝 Walkthrough

Walkthrough

Removed the enabled_model_catalog_config_map fixture and its usages across tests, deleted the get_catalog_url_and_headers utility, added "enabled": True to two default catalog entries, and added pytest.skip markers to several Hugging Face test modules.

Changes

Cohort / File(s) Summary
Fixture & conftest
tests/model_registry/model_catalog/conftest.py
Deleted enabled_model_catalog_config_map fixture; removed imports for get_catalog_url_and_headers and DEFAULT_MODEL_CATALOG_CM.
Catalog config tests
tests/model_registry/model_catalog/catalog_config/test_default_model_catalog.py
Removed enabled_model_catalog_config_map from pytestmark.usefixtures; removed configmap-based parametrized cases; dropped DEFAULT_CUSTOM_MODEL_CATALOG import; removed fixture parameters from multiple tests.
Metadata tests
tests/model_registry/model_catalog/metadata/test_catalog_preview.py, tests/model_registry/model_catalog/metadata/test_custom_properties.py, tests/model_registry/model_catalog/metadata/test_filter_options_endpoint.py, tests/model_registry/model_catalog/metadata/test_sources_endpoint.py
Removed enabled_model_catalog_config_map from usefixtures or test signatures; removed ConfigMap imports; added pytest.skip to some source-related tests.
Search tests
tests/model_registry/model_catalog/search/test_model_artifact_search.py, tests/model_registry/model_catalog/search/test_model_search.py
Removed enabled_model_catalog_config_map parameter from many test methods and removed unused ConfigMap imports; no other logic changes.
Sorting tests
tests/model_registry/model_catalog/sorting/test_model_artifacts_sorting.py, tests/model_registry/model_catalog/sorting/test_model_sorting.py, tests/model_registry/model_catalog/sorting/test_sorting_functionality.py
Removed enabled_model_catalog_config_map from test signatures and removed unused ConfigMap imports.
Utilities
tests/model_registry/model_catalog/utils.py
Deleted get_catalog_url_and_headers and removed DynamicClient/Route/retry-based route-discovery logic and related imports.
Constants
tests/model_registry/model_catalog/constants.py
Added "enabled": True to DEFAULT_CATALOGS["redhat_ai_models"] and DEFAULT_CATALOGS["redhat_ai_validated_models"].
Hugging Face tests (skipped)
tests/model_registry/model_catalog/huggingface/test_huggingface_exclude_models.py, tests/model_registry/model_catalog/huggingface/test_huggingface_model_search.py, tests/model_registry/model_catalog/huggingface/test_huggingface_model_sorting.py, tests/model_registry/model_catalog/huggingface/test_huggingface_model_validation.py
Added module-level pytest.mark.skip to skip these test modules.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: removal of the enabled_model_catalog_config_map fixture and its usage throughout the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@dbasunag dbasunag force-pushed the remove_enabled_catalog_fixture branch from 5dc0df6 to 61518af Compare January 9, 2026 22:39
@dbasunag
Copy link
Copy Markdown
Collaborator Author

/build-push-pr-image

@github-actions
Copy link
Copy Markdown

Status of building tag pr-1002: success.
Status of pushing tag pr-1002 to image registry: success.

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: 1

🤖 Fix all issues with AI agents
In @tests/model_registry/model_catalog/metadata/test_sources_endpoint.py:
- Around line 39-42: The test is using the skip function as a decorator
(pytest.skip(...)) which triggers module-level skip; replace the decorator with
the marker pytest.mark.skip(reason="...") on the test (or alternatively remove
the decorator and call pytest.skip("...", allow_module_level=False) inside the
test) so that only the specific test is skipped; update the decorator usage
where pytest.skip is applied to use pytest.mark.skip(...) instead.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb9dac4 and 5f0d764.

📒 Files selected for processing (1)
  • tests/model_registry/model_catalog/metadata/test_sources_endpoint.py
🧰 Additional context used
🪛 GitHub Actions: Tox Tests
tests/model_registry/model_catalog/metadata/test_sources_endpoint.py

[error] 1-1: pytest collection error: Using pytest.skip outside of a test will skip the entire module. Command 'uv run pytest --collect-only' exited with code 2.

🔇 Additional comments (1)
tests/model_registry/model_catalog/metadata/test_sources_endpoint.py (1)

79-108: The disabled_catalog_source fixture is self-contained and does not depend on the removed enabled_model_catalog_config_map. The fixture directly loads the sources.yaml ConfigMap, sets enabled = False for the specified catalog, and patches the ConfigMap independently. The test should work correctly as written.

@dbasunag dbasunag enabled auto-merge (squash) January 12, 2026 12:48
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 (2)
tests/model_registry/model_catalog/metadata/test_sources_endpoint.py (2)

39-42: Minor: Backslash continuation embeds extra whitespace in skip reason.

The backslash line continuation includes the indentation whitespace in the reason string. Consider using implicit string concatenation or a single line for cleaner output.

♻️ Suggested fix
     @pytest.mark.skip(
-        reason="This test should be included in https://github.com/opendatahub-io/opendatahub-tests/pull/999/ \
-        where we could disable a source catalog and verify it"
+        reason="This test should be included in https://github.com/opendatahub-io/opendatahub-tests/pull/999/ "
+        "where we could disable a source catalog and verify it"
     )

79-82: Same string formatting issue as above.

Apply the same implicit string concatenation fix here for consistency.

♻️ Suggested fix
     @pytest.mark.skip(
-        reason="This test should be included in https://github.com/opendatahub-io/opendatahub-tests/pull/999/ \
-        where we could disable a source catalog and verify it"
+        reason="This test should be included in https://github.com/opendatahub-io/opendatahub-tests/pull/999/ "
+        "where we could disable a source catalog and verify it"
     )
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb3ab01 and edf113c.

📒 Files selected for processing (1)
  • tests/model_registry/model_catalog/metadata/test_sources_endpoint.py

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

@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 (4)
tests/model_registry/model_catalog/huggingface/test_huggingface_model_sorting.py (1)

8-9: Add a reason to the skip marker for maintainability.

Skipping entire test modules without documenting why makes it difficult for future maintainers to understand the context and know when these tests should be re-enabled. Consider adding a reason parameter and optionally referencing a tracking ticket.

Suggested improvement
-pytestmark = [pytest.mark.skip]
+pytestmark = [pytest.mark.skip(reason="Pending fixture refactor - see RHOAIENG-XXXXX")]
tests/model_registry/model_catalog/huggingface/test_huggingface_model_search.py (1)

11-12: Add a reason to the skip marker for maintainability.

Same concern as the other test modules—skipping without a documented reason makes future maintenance harder. Include a reason parameter explaining why these tests are disabled.

Suggested improvement
-pytestmark = [pytest.mark.skip]
+pytestmark = [pytest.mark.skip(reason="Pending fixture refactor - see RHOAIENG-XXXXX")]
tests/model_registry/model_catalog/huggingface/test_huggingface_model_validation.py (1)

16-19: Add a reason to the skip marker for maintainability.

The usefixtures marker is retained (presumably for when tests are re-enabled), but the skip marker lacks a reason. Document why these tests are being skipped and when they should be re-enabled.

Suggested improvement
 pytestmark = [
     pytest.mark.usefixtures("updated_dsc_component_state_scope_session", "model_registry_namespace"),
-    pytest.mark.skip,
+    pytest.mark.skip(reason="Pending fixture refactor - see RHOAIENG-XXXXX"),
 ]
tests/model_registry/model_catalog/huggingface/test_huggingface_exclude_models.py (1)

10-13: Add a reason to the skip marker for maintainability.

Consistent with the other files in this PR, please add a reason parameter to document why these tests are skipped and provide a reference for tracking re-enablement.

Suggested improvement
 pytestmark = [
     pytest.mark.usefixtures("updated_dsc_component_state_scope_session", "model_registry_namespace"),
-    pytest.mark.skip,
+    pytest.mark.skip(reason="Pending fixture refactor - see RHOAIENG-XXXXX"),
 ]
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between edf113c and 2abc775.

📒 Files selected for processing (4)
  • tests/model_registry/model_catalog/huggingface/test_huggingface_exclude_models.py
  • tests/model_registry/model_catalog/huggingface/test_huggingface_model_search.py
  • tests/model_registry/model_catalog/huggingface/test_huggingface_model_sorting.py
  • tests/model_registry/model_catalog/huggingface/test_huggingface_model_validation.py

Copy link
Copy Markdown
Member

@mwaykole mwaykole 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 2faf1fe into opendatahub-io:main Jan 12, 2026
10 checks passed
@dbasunag dbasunag deleted the remove_enabled_catalog_fixture branch January 12, 2026 13:32
@github-actions
Copy link
Copy Markdown

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
…atahub-io#1002)

* Remove enabled_model_catalog_config_map fixture and it's usage

* test: remove catalog that are not the default one

* test: skip test to include fix in a follow pr

* test: skip because we need to disable the catalog source and this will be done later

* fix: use the right marker

---------

Co-authored-by: fege <[email protected]>
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