mirror of
https://github.com/meta-llama/llama-stack.git
synced 2026-01-01 12:00:00 +00:00
restructure config
This commit is contained in:
parent
702cf2d563
commit
26d9804efd
8 changed files with 218 additions and 62 deletions
|
|
@ -9,6 +9,10 @@ import pytest
|
|||
from ..conftest import get_provider_fixture_overrides
|
||||
|
||||
from ..inference.fixtures import INFERENCE_FIXTURES
|
||||
from ..test_config_helper import (
|
||||
get_provider_fixtures_from_config,
|
||||
try_load_config_file_cached,
|
||||
)
|
||||
from .fixtures import MEMORY_FIXTURES
|
||||
|
||||
|
||||
|
|
@ -65,6 +69,15 @@ def pytest_configure(config):
|
|||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
test_config = try_load_config_file_cached(metafunc.config.getoption("config"))
|
||||
provider_fixtures_config = (
|
||||
test_config.memory.fixtures.provider_fixtures
|
||||
if test_config is not None
|
||||
else None
|
||||
)
|
||||
custom_fixtures = get_provider_fixtures_from_config(
|
||||
provider_fixtures_config, DEFAULT_PROVIDER_COMBINATIONS
|
||||
)
|
||||
if "embedding_model" in metafunc.fixturenames:
|
||||
model = metafunc.config.getoption("--embedding-model")
|
||||
if model:
|
||||
|
|
@ -80,7 +93,8 @@ def pytest_generate_tests(metafunc):
|
|||
"memory": MEMORY_FIXTURES,
|
||||
}
|
||||
combinations = (
|
||||
get_provider_fixture_overrides(metafunc.config, available_fixtures)
|
||||
custom_fixtures
|
||||
or get_provider_fixture_overrides(metafunc.config, available_fixtures)
|
||||
or DEFAULT_PROVIDER_COMBINATIONS
|
||||
)
|
||||
metafunc.parametrize("memory_stack", combinations, indirect=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue