fix(tests): ensure test isolation in server mode

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
This commit is contained in:
Ashwin Bharambe 2025-10-08 11:00:49 -07:00
parent bba9957edd
commit d5296a35f6
4 changed files with 219 additions and 106 deletions

View file

@ -128,7 +128,10 @@ def strip_rich_markup(text):
class CustomRichHandler(RichHandler):
def __init__(self, *args, **kwargs):
kwargs["console"] = Console()
# Set a reasonable default width for console output, especially when redirected to files
console_width = int(os.environ.get("LLAMA_STACK_LOG_WIDTH", "120"))
# Don't force terminal codes to avoid ANSI escape codes in log files
kwargs["console"] = Console(width=console_width)
super().__init__(*args, **kwargs)
def emit(self, record):