Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com>
Co-authored-by: Hdandria <henri.dandria@mistral.ai>
Co-authored-by: Ivana Dunisijevic <ivana.dunisijevic@mistral.ai>
Co-authored-by: Jean Burellier <sheplu@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Mert Unsal <mert.unsal@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Val <102326092+vdeva@users.noreply.github.com>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: renovate-mistral[bot] <253709520+renovate-mistral[bot]@users.noreply.github.com>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Clément Drouin 2026-06-19 11:01:24 +02:00 committed by GitHub
parent 564a14365e
commit 6bedf271ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
223 changed files with 10533 additions and 6947 deletions

View file

@ -2,6 +2,7 @@ from __future__ import annotations
import pytest
from tests.constants import ANTHROPIC_BASE_URL
from vibe.core.config import OtelSpanExporterConfig, ProviderConfig, VibeConfig
from vibe.core.types import Backend
@ -62,7 +63,7 @@ class TestOtelSpanExporterConfig:
update={
"providers": [
ProviderConfig(
name="anthropic", api_base="https://api.anthropic.com/v1"
name="anthropic", api_base=f"{ANTHROPIC_BASE_URL}/v1"
)
]
}
@ -80,6 +81,18 @@ class TestOtelSpanExporterConfig:
assert result is not None
assert result.endpoint == "https://api.mistral.ai/telemetry/v1/traces"
def test_resolves_api_key_from_keyring(
self, vibe_config: VibeConfig, monkeypatch: pytest.MonkeyPatch
) -> None:
# Key stored only in the OS keyring (no env var) must still authenticate OTEL.
monkeypatch.delenv("MISTRAL_API_KEY", raising=False)
monkeypatch.setattr(
"keyring.get_password", lambda service, username: "sk-keyring"
)
result = vibe_config.otel_span_exporter_config
assert result is not None
assert result.headers == {"Authorization": "Bearer sk-keyring"}
def test_returns_none_and_warns_when_api_key_missing(
self,
vibe_config: VibeConfig,