llama-stack-mirror/tests/integration/common/recordings/c34cccb2af2fb9f02f7136b0dd350e75e7d2a77d222ef26a9bc419e10fa33c56.json
Ashwin Bharambe 79bed44b04
fix(tests): ensure test isolation in server mode (#3737)
Propagate test IDs from client to server via HTTP headers to maintain
proper test isolation when running with server-based stack configs.
Without
this, recorded/replayed inference requests in server mode would leak
across
tests.

Changes:
- Patch client _prepare_request to inject test ID into provider data
header
- Sync test context from provider data on server side before storage
operations
- Set LLAMA_STACK_TEST_STACK_CONFIG_TYPE env var based on stack config
- Configure console width for cleaner log output in CI
- Add SQLITE_STORE_DIR temp directory for test data isolation
2025-10-08 12:03:36 -07:00

57 lines
2.5 KiB
JSON

{
"test_id": null,
"request": {
"method": "POST",
"url": "http://0.0.0.0:11434/v1/v1/chat/completions",
"headers": {},
"body": {
"model": "llama3.2:3b-instruct-fp16",
"messages": [
{
"role": "user",
"content": "Test trace openai 0"
}
],
"stream": false
},
"endpoint": "/v1/chat/completions",
"model": "llama3.2:3b-instruct-fp16"
},
"response": {
"body": {
"__type__": "openai.types.chat.chat_completion.ChatCompletion",
"__data__": {
"id": "rec-c34cccb2af2f",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "I'm happy to help you with testing the Discord API but I can't test for you. You can use the following code to get started:\n\n```\nimport discord\nfrom discord.ext import commands\n\n# Replace these values with your own bot token and guild ID\nTOKEN = 'your_discord_bot_token'\nGUILD_ID = 'your_guild_id'\n\n# Create a new bot instance\nbot = commands.Bot(command_prefix='!')\n\n# Event that triggers when the bot is ready\n@bot.event\nasync def on_ready():\n # Print a message to indicate that the bot is online\n print(f'{bot.user.name} has connected to Discord!')\n\n# Command that says 'Hello, world!'\n@bot.command(name='hello')\nasync def hello(ctx):\n # Send a message with a greeting\n await ctx.send(':hello: Hello, world!')\n\n# Run the bot and keep it alive until it's stopped manually\nbot.run(TOKEN)\n```\n\nMake sure to replace `'your_discord_bot_token'` and `'your_guild_id'` with the appropriate values for your Discord API credentials.\n\nTo run this code, you'll need to install the `discord.py` library using pip:\n\n```bash\npip install discord.py\n```\n\nPlease note that you can't test the API since we are not logging in and testing on a bot.",
"refusal": null,
"role": "assistant",
"annotations": null,
"audio": null,
"function_call": null,
"tool_calls": null
}
}
],
"created": 0,
"model": "llama3.2:3b-instruct-fp16",
"object": "chat.completion",
"service_tier": null,
"system_fingerprint": "fp_ollama",
"usage": {
"completion_tokens": 275,
"prompt_tokens": 31,
"total_tokens": 306,
"completion_tokens_details": null,
"prompt_tokens_details": null
}
}
},
"is_streaming": false
}
}