Skip to content

Add QG Markers for AI Safety and marker deprecation warning#1193

Merged
dbasunag merged 3 commits intoopendatahub-io:mainfrom
sheltoncyril:add-me-markers
Mar 10, 2026
Merged

Add QG Markers for AI Safety and marker deprecation warning#1193
dbasunag merged 3 commits intoopendatahub-io:mainfrom
sheltoncyril:add-me-markers

Conversation

@sheltoncyril
Copy link
Copy Markdown
Contributor

@sheltoncyril sheltoncyril commented Mar 10, 2026

Add tier1, tier2 and smoke markers to AI Safety Tests and add a sanity marker deprecation warning

Summary by CodeRabbit

  • Chores
    • Updated test infrastructure and categorization across multiple test suites, including marker deprecation notices and tier-level classifications for improved test organization and selection.

@github-actions
Copy link
Copy Markdown

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

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 10, 2026

📝 Walkthrough

Walkthrough

Changes add pytest marker decorators (tier1, smoke) across multiple test files for improved test categorization and selection. Configuration update adds deprecation notice to pytest.ini. One test file restructures tier2 testing into a dedicated test function separate from parameterized tier1 tests.

Changes

Cohort / File(s) Summary
Test marker additions
tests/llama_stack/safety/test_trustyai_fms_provider.py, tests/model_explainability/guardrails/test_guardrails.py, tests/model_explainability/trustyai_service/service/test_trustyai_service.py
Decorator additions (@pytest.mark.tier1, @pytest.mark.smoke) for test categorization. Smoke marker shifted to parameterization level in one file.
Configuration update
pytest.ini
Deprecation notice inserted into sanity test marker description.
Test tier refactoring
tests/model_explainability/lm_eval/test_lm_eval.py
Tier2 parameterization removed from combined HuggingFace test and moved into dedicated test_lmeval_huggingface_model_tier2 function. Existing tests annotated with @pytest.mark.tier1.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is a single-line summary lacking required template sections: Summary, Related Issues, How it has been tested, and Additional Requirements are all missing. Expand description to match the repository template. Include Summary section explaining the rationale, Related Issues links, testing methodology, and confirmation of Additional Requirements.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: adding test markers (tier1, tier2, smoke) and a deprecation warning to the sanity marker.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

🧹 Nitpick comments (2)
pytest.ini (1)

14-14: Deprecation notice is informational only.

The inline deprecation warning in the marker description won't trigger pytest's deprecation warning system. If you want pytest to emit actual warnings when @pytest.mark.sanity is used, consider using a pytest_configure hook with warnings.warn() in conftest.py.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pytest.ini` at line 14, The marker description for the pytest mark "sanity"
is only an inline note and won't trigger pytest deprecation warnings; add a
pytest_configure hook in conftest.py that registers the "sanity" marker and
emits a real deprecation via warnings.warn() when the marker is used (use
pytest.Config.getini or inspect node.iter_markers for "sanity" in
pytest_collection_modifyitems or in pytest_configure to detect usage), update
the marker registration to include the deprecation note, and ensure the warning
uses the proper DeprecationWarning category so pytest will surface it.
tests/model_explainability/guardrails/test_guardrails.py (1)

217-217: Minor formatting: missing space after comma.

-    "model_namespace, orchestrator_config, guardrails_gateway_config,guardrails_orchestrator",
+    "model_namespace, orchestrator_config, guardrails_gateway_config, guardrails_orchestrator",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/model_explainability/guardrails/test_guardrails.py` at line 217, The
tuple/string argument list in the test contains a missing space after a comma in
the literal "model_namespace, orchestrator_config,
guardrails_gateway_config,guardrails_orchestrator"; update that literal so
there's a space after the comma (i.e., "..., guardrails_gateway_config,
guardrails_orchestrator") in
tests/model_explainability/guardrails/test_guardrails.py to fix the formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/model_explainability/lm_eval/test_lm_eval.py`:
- Around line 58-73: The test function test_lmeval_huggingface_model_tier2
currently declares unused fixture parameters admin_client and model_namespace;
remove them from the function signature or convert them to setup-only fixtures
by adding `@pytest.mark.usefixtures`("admin_client", "model_namespace") above the
test. Update the declaration for test_lmeval_huggingface_model_tier2 (which uses
lmevaljob_hf_pod) to match the pattern used in test_lmeval_huggingface_model so
those fixtures remain available for dependency setup without being passed as
unused parameters.

---

Nitpick comments:
In `@pytest.ini`:
- Line 14: The marker description for the pytest mark "sanity" is only an inline
note and won't trigger pytest deprecation warnings; add a pytest_configure hook
in conftest.py that registers the "sanity" marker and emits a real deprecation
via warnings.warn() when the marker is used (use pytest.Config.getini or inspect
node.iter_markers for "sanity" in pytest_collection_modifyitems or in
pytest_configure to detect usage), update the marker registration to include the
deprecation note, and ensure the warning uses the proper DeprecationWarning
category so pytest will surface it.

In `@tests/model_explainability/guardrails/test_guardrails.py`:
- Line 217: The tuple/string argument list in the test contains a missing space
after a comma in the literal "model_namespace, orchestrator_config,
guardrails_gateway_config,guardrails_orchestrator"; update that literal so
there's a space after the comma (i.e., "..., guardrails_gateway_config,
guardrails_orchestrator") in
tests/model_explainability/guardrails/test_guardrails.py to fix the formatting.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: c853b2f6-2653-4a7c-84f7-380345bd9f69

📥 Commits

Reviewing files that changed from the base of the PR and between 9a1ab3b and b914d3e.

📒 Files selected for processing (5)
  • pytest.ini
  • tests/llama_stack/safety/test_trustyai_fms_provider.py
  • tests/model_explainability/guardrails/test_guardrails.py
  • tests/model_explainability/lm_eval/test_lm_eval.py
  • tests/model_explainability/trustyai_service/service/test_trustyai_service.py

Comment thread tests/model_explainability/lm_eval/test_lm_eval.py
@dbasunag dbasunag enabled auto-merge (squash) March 10, 2026 14:37
@dbasunag dbasunag merged commit a811bea into opendatahub-io:main Mar 10, 2026
8 checks passed
@github-actions
Copy link
Copy Markdown

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

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