test(maas): add subscription enforcement tests for TinyLlama#1163
test(maas): add subscription enforcement tests for TinyLlama#1163sheltoncyril merged 5 commits intoopendatahub-io:mainfrom
Conversation
|
The following are automatically added/executed:
Available user actions:
Supported labels{'/cherry-pick', '/wip', '/build-push-pr-image', '/hold', '/lgtm', '/verified'} |
for more information, see https://pre-commit.ci
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated MaaS subscription fixtures to change Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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_serving/model_server/maas_billing/maas_subscription/conftest.py`:
- Around line 176-196: The fixture maas_auth_policy_no_subscription is defined
but not used; either remove this unused fixture or wire it into the appropriate
test(s) by adding maas_auth_policy_no_subscription as a parameter to the test
function(s) that should validate authenticated-but-no-subscription behavior
(e.g., tests that reference MaaSModel maas_model_tinyllama_premium or rely on
MaaSAuthPolicy); if keeping it, ensure the test imports/accepts the fixture name
so the with-block in maas_auth_policy_no_subscription (which creates a
MaaSAuthPolicy resource and waits for Ready) actually executes, otherwise delete
the maas_auth_policy_no_subscription fixture to clean up dead code.
In
`@tests/model_serving/model_server/maas_billing/maas_subscription/test_maas_sub_enforcement.py`:
- Around line 98-127: The test test_auth_pass_no_subscription_gets_429 never
updates last_resp inside the TimeoutSampler loop so the pytest.fail message is
unhelpful; inside the loop where resp is received from TimeoutSampler (the
iteration calling request_session_http.post), assign last_resp = resp on each
iteration (e.g., immediately after receiving resp) so the final failure message
can show the most recent response status and body; adjust references in the loop
surrounding TimeoutSampler, resp, and last_resp accordingly.
- Around line 98-127: Rename or clarify the test name and fix the unassigned
response variable: change the test function
test_auth_pass_no_subscription_gets_429 to reflect that it is validating
behavior when the x-maas-subscription header is omitted (e.g.,
test_auth_pass_missing_subscription_header_gets_429) or, if you intended to test
a truly unsubscribed actor, switch the parametrized ocp_token_for_actor to an
actor type/group that has no subscription; additionally, inside the
TimeoutSampler loop in test_auth_pass_no_subscription_gets_429 (or the renamed
function) assign last_resp = resp on each iteration so the final failure message
reports the real last response status/text.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
tests/model_serving/model_server/maas_billing/maas_subscription/conftest.pytests/model_serving/model_server/maas_billing/maas_subscription/test_maas_sub_enforcement.py
|
Status of building tag latest: success. |
Pull Request
Summary
This PR adds TinyLlama premium subscription tests:
Related Issues
How it has been tested
Summary by CodeRabbit