You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
<!--- Describe your changes in detail -->
This PR adds comprehensive E2E test coverage for the `/v1/models`
endpoint that validates subscription-aware model filtering and access
control.
**Test Coverage:**
- **Single subscription auto-selection**: Users with one subscription
can list models without providing `x-maas-subscription` header
- **Explicit subscription header**: Users with multiple subscriptions
can select which subscription to use
- **Multiple subscriptions requiring header**: Validates proper 403
error when header is missing
- **Subscription filtering and validation**: Ensures models are filtered
by subscription access
- **Model deduplication scenarios**: Tests handling of multiple
modelRefs serving the same model
- **Empty model lists**: Validates response when user has no accessible
models
- **Response schema validation**: Ensures API responses match
OpenAI-compatible schema
- **Error cases**: Tests 401 (unauthenticated) and 403 (forbidden)
scenarios
**Sample Resources:**
- Added two distinct test models (`e2e-distinct-simulated`,
`e2e-distinct-2-simulated`) to enable multi-model subscription testing
- Added corresponding MaaSModelRef kustomize configurations for test
deployment
**Known Issues (marked as xfail):**
Three tests expose a known bug where `/v1/models` returns all accessible
models instead of filtering by the selected subscription. These are
marked with `@pytest.mark.xfail` and will
pass once the filtering bug is fixed:
- `test_single_subscription_auto_select`
- `test_explicit_subscription_header`
- `test_multiple_distinct_models_in_subscription`
## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
**Test Execution:**
```bash
cd test/e2e
./scripts/prow_run_smoke_test.sh
Results:
- 12 tests passed
- 3 tests xfailed (expected failures due to known bug)
- 0 tests failed
- All tests run in isolated namespaces with proper cleanup
Environment:
- OpenShift cluster with MaaS components deployed
- maas-controller watching models-as-a-service namespace
- Models deployed in llm namespace
- Kuadrant/Authorino for authorization
- PostgreSQL backend for API key storage
Validation:
- Verified subscription-based access control works correctly
- Verified API key authentication flow
- Verified OpenAI-compatible response format
- Verified proper error handling for unauthorized access
## Merge criteria:
<!--- This PR will be merged by any repository approver when it meets
all the points in the checklist -->
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] The commits are squashed in a cohesive manner and have meaningful
messages.
- [x] Testing instructions have been added in the PR body (for PRs
involving changes that are not immediately obvious).
- [x] The developer has manually tested the changes and verified that
the changes work
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Added sample Kustomize and model manifests (including MaaSModelRef) to
demonstrate distinct multi-model deployments and updated top-level
samples to include distinct and distinct-2 entries.
* **Tests**
* Added comprehensive end-to-end tests for the /v1/models endpoint
covering subscription-aware filtering, multi-model scenarios, auth/error
paths and deduplication checks; updated test runner to include them and
added env vars to support multi-model testing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
⚠️ **Do not use this kustomization for production or sample installations.** It includes test-only models that are designed to validate edge cases and should not be deployed in normal usage scenarios. For sample installations, use `docs/samples/maas-system/` instead.
0 commit comments