LLM settings environment-configurable

This commit is contained in:
2026-04-26 03:16:46 +02:00
parent df2d573d96
commit 1881daea32
3 changed files with 24 additions and 1 deletions

View File

@@ -193,6 +193,20 @@ def test_api_service_settings_can_enable_llm_extractor(monkeypatch, tmp_path):
assert service.llm_extractor is not None
def test_settings_can_load_from_environment(monkeypatch):
monkeypatch.setenv("REPO_REGISTRY_DATABASE_PATH", "var/env.sqlite3")
monkeypatch.setenv("REPO_REGISTRY_CHECKOUT_ROOT", "var/env-checkouts")
monkeypatch.setenv("REPO_REGISTRY_LLM_PROVIDER", "mock")
monkeypatch.setenv("REPO_REGISTRY_LLM_MODEL", "demo-model")
settings = Settings()
assert settings.database_path == "var/env.sqlite3"
assert settings.checkout_root == "var/env-checkouts"
assert settings.llm_provider == "mock"
assert settings.llm_model == "demo-model"
def test_api_analysis_run_loop(tmp_path):
source = tmp_path / "repo"
source.mkdir()