chore: noise in tests

This commit is contained in:
2026-05-04 06:18:06 +02:00
parent 4de8492c4f
commit 43a4610ce7
48 changed files with 619 additions and 239 deletions

View File

@@ -206,7 +206,8 @@ defmodule BDS.AITest do
{:ok,
%{
json: %{
"title" => "Analyzed " <> (get_in(request.messages, [Access.at(1), "content"]) || ""),
"title" =>
"Analyzed " <> (get_in(request.messages, [Access.at(1), "content"]) || ""),
"excerpt" => "Analyzed excerpt",
"slug" => "analyzed-slug"
},
@@ -386,17 +387,22 @@ defmodule BDS.AITest do
{:ok, {_address, port}} = ThousandIsland.listener_info(server)
assert {:error, %{kind: :invalid_json_response, reason: %Jason.DecodeError{}}} =
BDS.AI.OpenAICompatibleRuntime.generate(
%{url: "http://127.0.0.1:#{port}/v1", api_key: nil},
%{
model: "gpt-test",
messages: [%{"role" => "user", "content" => "Hello"}],
max_output_tokens: 128,
tools: []
},
[]
)
log =
capture_log(fn ->
assert {:error, %{kind: :invalid_json_response, reason: %Jason.DecodeError{}}} =
BDS.AI.OpenAICompatibleRuntime.generate(
%{url: "http://127.0.0.1:#{port}/v1", api_key: nil},
%{
model: "gpt-test",
messages: [%{"role" => "user", "content" => "Hello"}],
max_output_tokens: 128,
tools: []
},
[]
)
end)
assert log =~ "AI OpenAI-compatible response normalization failed"
end
test "openai-compatible generation accepts title requests without tools" do