Skip to content

Commit b02461b

Browse files
feat: Add integration test for service_tier with openai client (#5103)
# What does this PR do? <!-- Provide a short summary of what this PR does and why. Link to relevant issues if applicable. --> <!-- If resolving an issue, uncomment and update the line below --> Related to #4817 ## Test Plan <!-- Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.* --> ```console (llama-stack) gualiu@gualiu-mac llama-stack % pytest -s -v tests/integration/responses/test_openai_responses.py --stack-config=server:ci-tests --inference-mode record-if-missing -k "service_tier" --setup=gpt --suite=responses --color=yes --embedding-model=sentence-transformers/nomic-ai/nomic-embed-text-v1.5 --color=yes --capture=tee-sys ================================================================== test session starts ================================================================== platform darwin -- Python 3.12.7, pytest-8.4.2, pluggy-1.6.0 -- /Users/gualiu/go/src/github.com/llamastack/llama-stack/.venv/bin/python3 cachedir: .pytest_cache metadata: {'Python': '3.12.7', 'Platform': 'macOS-26.3.1-arm64-arm-64bit', 'Packages': {'pytest': '8.4.2', 'pluggy': '1.6.0'}, 'Plugins': {'anyio': '4.9.0', 'html': '4.1.1', 'socket': '0.7.0', 'asyncio': '1.1.0', 'json-report': '1.5.0', 'timeout': '2.4.0', 'metadata': '3.1.1', 'cov': '6.2.1', 'nbval': '0.11.0'}} rootdir: /Users/gualiu/go/src/github.com/llamastack/llama-stack configfile: pyproject.toml plugins: anyio-4.9.0, html-4.1.1, socket-0.7.0, asyncio-1.1.0, json-report-1.5.0, timeout-2.4.0, metadata-3.1.1, cov-6.2.1, nbval-0.11.0 asyncio: mode=Mode.AUTO, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function collected 37 items / 26 deselected / 11 selected tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_auto[txt=openai/gpt-4o] instantiating llama_stack_client Starting llama stack server with config 'ci-tests' on port 8321... Waiting for server at http://localhost:8321... (0.0s elapsed) Waiting for server at http://localhost:8321... (0.5s elapsed) Server is ready at http://localhost:8321 llama_stack_client instantiated in 2.560s PASSED [ 9%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier[txt=openai/gpt-4o-default] PASSED [ 18%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_flex[txt=openai/gpt-4o] PASSED [ 27%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_auto_streaming[txt=openai/gpt-4o] PASSED [ 36%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_streaming[txt=openai/gpt-4o-default] PASSED [ 45%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_flex_streaming[txt=openai/gpt-4o] PASSED [ 54%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_auto_and_previous_response[txt=openai/gpt-4o] PASSED [ 63%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_and_previous_response[txt=openai/gpt-4o-default] PASSED [ 72%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier[txt=openai/gpt-4o-priority] PASSED [ 81%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_streaming[txt=openai/gpt-4o-priority] PASSED [ 90%] tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_and_previous_response[txt=openai/gpt-4o-priority] PASSED [100%]Terminating llama stack server process... Terminating process 82632 and its group... Server process and children terminated gracefully ================================================================= slowest 10 durations ================================================================== 2.58s setup tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_auto[txt=openai/gpt-4o] 0.24s teardown tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_and_previous_response[txt=openai/gpt-4o-priority] 0.14s call tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_auto[txt=openai/gpt-4o] 0.01s call tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_auto_streaming[txt=openai/gpt-4o] 0.01s call tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_streaming[txt=openai/gpt-4o-default] 0.01s call tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_streaming[txt=openai/gpt-4o-priority] 0.01s call tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_auto_and_previous_response[txt=openai/gpt-4o] 0.01s call tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_and_previous_response[txt=openai/gpt-4o-default] 0.01s call tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier_and_previous_response[txt=openai/gpt-4o-priority] 0.01s call tests/integration/responses/test_openai_responses.py::TestOpenAIResponses::test_openai_response_with_service_tier[txt=openai/gpt-4o-default] ===================================================== 11 passed, 26 deselected, 2 warnings in 3.08s ===================================================== ``` Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 85b0481 commit b02461b

16 files changed

Lines changed: 17100 additions & 4 deletions

docs/docs/api-openai/conformance.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ This documentation is auto-generated from the OpenAI API specification compariso
2727

2828
## Integration Test Coverage
2929

30-
**Overall Test Coverage Score: 42.5%**
30+
**Overall Test Coverage Score: 43.4%**
3131

3232
| Category | Covered | Total | Score |
3333
|----------|---------|-------|-------|
3434
| CRUD Operations | 4 | 5 | 80.0% |
3535
| Conversations | 5 | 9 | 55.6% |
36-
| Request Parameters | 18 | 24 | 75.0% |
36+
| Request Parameters | 19 | 24 | 79.2% |
3737
| Streaming Events | 16 | 53 | 30.2% |
3838
| Structured Output | 0 | 2 | 0.0% |
3939
| Tools | 2 | 13 | 15.4% |
@@ -973,7 +973,7 @@ Below is a detailed breakdown of conformance issues and missing properties for e
973973
| `requestBody.content.application/json.properties.model` | Type added: ['string']; Nullable removed (OpenAI nullable); Union variants removed: 2 | Yes |
974974
| `requestBody.content.application/json.properties.parallel_tool_calls` | Default changed: None -> True | Yes |
975975
| `requestBody.content.application/json.properties.reasoning` | Union variants added: 1; Union variants removed: 1 | No |
976-
| `requestBody.content.application/json.properties.service_tier` | Union variants added: 2 | No |
976+
| `requestBody.content.application/json.properties.service_tier` | Union variants added: 2 | Yes |
977977
| `requestBody.content.application/json.properties.store` | Type removed: ['boolean']; Nullable added (OpenAI non-nullable); Union variants added: 2; Default changed: None -> True | Yes |
978978
| `requestBody.content.application/json.properties.stream` | Type removed: ['boolean']; Nullable added (OpenAI non-nullable); Union variants added: 2; Default changed: None -> False | Yes |
979979
| `requestBody.content.application/json.properties.text` | Union variants added: 1; Union variants removed: 1 | No |
@@ -988,7 +988,7 @@ Below is a detailed breakdown of conformance issues and missing properties for e
988988
| `responses.200.content.application/json.properties.parallel_tool_calls` | Type removed: ['boolean']; Nullable added (OpenAI non-nullable); Union variants added: 2; Default changed: None -> True | Yes |
989989
| `responses.200.content.application/json.properties.presence_penalty` | Type removed: ['number']; Nullable added (OpenAI non-nullable); Union variants added: 2 | No |
990990
| `responses.200.content.application/json.properties.reasoning` | Union variants added: 1; Union variants removed: 1 | No |
991-
| `responses.200.content.application/json.properties.service_tier` | Type removed: ['string']; Nullable added (OpenAI non-nullable); Union variants added: 2 | No |
991+
| `responses.200.content.application/json.properties.service_tier` | Type removed: ['string']; Nullable added (OpenAI non-nullable); Union variants added: 2 | Yes |
992992
| `responses.200.content.application/json.properties.temperature` | Type removed: ['number']; Nullable added (OpenAI non-nullable); Union variants added: 2 | Yes |
993993
| `responses.200.content.application/json.properties.text` | Type added: ['object'] | No |
994994
| `responses.200.content.application/json.properties.tool_choice` | Union variants added: 3 | Yes |

0 commit comments

Comments
 (0)