mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 04:04:14 +00:00
feat(api): ensure StackRunConfig
StackRunConfig is part of our public API, ensure stability of this datatype using a pytest snapshot test. If the pydantic model changes, it will fail. Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
parent
d266c59c2a
commit
e408fd3421
11 changed files with 2052 additions and 1 deletions
25
scripts/api-conformance.sh
Executable file
25
scripts/api-conformance.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Simple test runner for API conformance tests
|
||||
# Runs pytest with snapshot testing for Pydantic models
|
||||
|
||||
# Get the script directory
|
||||
THIS_DIR=$(dirname "$0")
|
||||
ROOT_DIR="$THIS_DIR/.."
|
||||
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
# Run pytest with snapshot testing
|
||||
echo "=== Running API Conformance Tests ==="
|
||||
pytest -s -v tests/ \
|
||||
--snapshot-update \
|
||||
"$@"
|
||||
|
||||
echo "✅ API Conformance Tests Complete"
|
14
scripts/pydantic-diff.py
Normal file
14
scripts/pydantic-diff.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from llama_stack.core.datatypes import StackRunConfig
|
||||
|
||||
|
||||
def test_build_config_v1_schema_is_unchanged(snapshot):
|
||||
"""
|
||||
Ensures the V1 schema never changes.
|
||||
"""
|
||||
snapshot.assert_match(StackRunConfig.model_json_schema(), "stored_build_config_v1_schema.json")
|
Loading…
Add table
Add a link
Reference in a new issue