8000 test: keep the scaling schedule and setup assistant tests green on main by adeelahmad · Pull Request #648 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fastapi_backend/tests/api/test_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ def test_rules_scale_on_waiting_jobs_and_on_a_schedule(client, db, cfg, h, fake)
g["rules"][1]["says"],
] and "max 1" in g["rules"][1]["says"]
gid = g["id"]
# the schedule fires at its first cron time after the group was made: make that this test's clock, not the real one
db.q("UPDATE $g SET created_at = $t, updated_at = $t", g=R("scale_group", gid), t=NOW.isoformat())
for _ in range(6):
db.q("CREATE job CONTENT {status: 'queued', next_step: 'transcribe', created_at: $t}", t=NOW.isoformat())
assert tick(db, cfg)["launched"] == 0 # the condition has to hold for 2 minutes
Expand Down
5 changes: 4 additions & 1 deletion fastapi_backend/tests/api/test_setup_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import pytest

from app.domain import rss, settings, setup, store
from app.domain import chat, rss, settings, setup, store
from tests import fake_llm
from tests.api._assist import Assist, sse, start_llm
from tests.api.test_news_feed_source import site # noqa: F401 - a news feed served from this process
Expand Down Expand Up @@ -45,6 +45,9 @@ def held(c, h, data, name="talk.wav"):
def test_a_setup_conversation_sets_the_server_up(app, db, cfg, folder, new_client, llm, monkeypatch):
s = Assist(app, db, cfg, folder, new_client)
c, h = s.cl["admin"]
# room for every tool's whole result: at the default window the setup tools' own list leaves too little, and the
# results the model read are cut in the middle (chat.fit), so they wouldn't parse below
monkeypatch.setattr(chat, "CONTEXT_TOKENS", 128000)
monkeypatch.setattr(
setup, "detect_llm", lambda: [{"kind": "Ollama", "base_url": "http://x:11434/v1", "models": ["m"], "suggested": "m"}]
)
Expand Down
Loading
0