From a4c3aeb4648110e30101915e6254d1a6bd38c6a7 Mon Sep 17 00:00:00 2001 From: Jesse Drelick Date: Sat, 17 Aug 2024 00:34:12 -0400 Subject: [PATCH] lm test tag --- config/config.exs | 4 +--- mix.exs | 14 +++++++++++++- test/agens/job_test.exs | 8 ++++++++ test/support/serving.ex | 3 --- test/test_helper.exs | 6 ++---- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/config/config.exs b/config/config.exs index cf38ede..86d9c83 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,5 +1,3 @@ import Config -config :agens, - registry: Agens.Registry, - real_llm: false +config :agens, registry: Agens.Registry diff --git a/mix.exs b/mix.exs index 0cbe415..29b5ea3 100644 --- a/mix.exs +++ b/mix.exs @@ -14,7 +14,12 @@ defmodule Agens.MixProject do description: "Create multi-agent workflows with AI and Language Models using OTP components for reliable and scalable automation.", package: package(), - docs: docs() + docs: docs(), + aliases: aliases(), + preferred_cli_env: [ + "test.all": :test, + "test.lm": :test + ] ] end @@ -92,4 +97,11 @@ defmodule Agens.MixProject do defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] + + defp aliases do + [ + "test.all": ["test --include lm"], + "test.lm": ["test --only lm"] + ] + end end diff --git a/test/agens/job_test.exs b/test/agens/job_test.exs index 7fa1946..9b502cf 100644 --- a/test/agens/job_test.exs +++ b/test/agens/job_test.exs @@ -224,4 +224,12 @@ defmodule Agens.JobTest do assert_receive {:job_ended, ^name, :complete} end end + + describe "lm" do + + @tag :lm + test "run job" do + assert true + end + end end diff --git a/test/support/serving.ex b/test/support/serving.ex index 78dec5a..885003e 100644 --- a/test/support/serving.ex +++ b/test/support/serving.ex @@ -41,7 +41,4 @@ defmodule Test.Support.Serving do {:reply, "STUB RUN", state} end end - - def get(true), do: LLM.get() - def get(false), do: Stub.get() end diff --git a/test/test_helper.exs b/test/test_helper.exs index 0633d08..fd7a959 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1,5 +1,3 @@ -real_llm? = Application.get_env(:agens, :real_llm, false) - Supervisor.start_link( [ {Agens.Supervisor, name: Agens.Supervisor} @@ -9,10 +7,10 @@ Supervisor.start_link( %Agens.Serving.Config{ name: :text_generation, - serving: Test.Support.Serving.get(real_llm?) + serving: Test.Support.Serving.Stub } |> Agens.Serving.start() :meck.new(Agent, [:passthrough]) -ExUnit.start() +ExUnit.start(exclude: [:lm])