test(fase2): gated live local + Foundry profile checks
This commit is contained in:
parent
156df15417
commit
308b5539e2
2 changed files with 66 additions and 0 deletions
27
tests/test_foundry_profile_live.py
Normal file
27
tests/test_foundry_profile_live.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
"""Step 14 — GATED live Foundry-profile check (trivial response on the cheapest model, D6).
|
||||
|
||||
NOT default CI: skips cleanly without a configured Foundry endpoint + deployment. When set, a
|
||||
trivial agent responds on a real FoundryChatClient (cheapest model, hard-capped per D6).
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
from agent_framework import Agent
|
||||
|
||||
from portfolio_optimiser.backends import AzureFoundryBackend
|
||||
|
||||
_ENDPOINT = os.environ.get("PORTFOLIO_FOUNDRY_PROJECT_ENDPOINT")
|
||||
_DEPLOYMENT = os.environ.get("PORTFOLIO_FOUNDRY_DEPLOYMENT")
|
||||
_NO_FOUNDRY = not (_ENDPOINT and _DEPLOYMENT)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
_NO_FOUNDRY,
|
||||
reason="Foundry not configured (set PORTFOLIO_FOUNDRY_PROJECT_ENDPOINT + PORTFOLIO_FOUNDRY_DEPLOYMENT)",
|
||||
)
|
||||
async def test_foundry_profile_trivial_response() -> None:
|
||||
client = AzureFoundryBackend().create_chat_client(model=_DEPLOYMENT) # type: ignore[arg-type]
|
||||
agent = Agent(client, "Answer in exactly one word.", name="probe")
|
||||
result = await agent.run("Reply with the single word OK.")
|
||||
assert getattr(result, "text", "") # a trivial response came back
|
||||
Loading…
Add table
Add a link
Reference in a new issue