88
99# pylint: disable=too-many-lines
1010
11- import logging
1211import os
1312import stat
1413from pathlib import Path
@@ -741,15 +740,6 @@ def test_synthesize_vllm_appends_and_keeps_conditional_openai(
741740 assert any (entry ["provider_id" ] == "vllm" for entry in _inference_entries (resolved ))
742741
743742
744- def _byo_llm_deprecation_warnings (caplog : pytest .LogCaptureFixture ) -> list [str ]:
745- """Return WARN records that name the byo-llm baseline replacement."""
746- return [
747- record .getMessage ()
748- for record in caplog .records
749- if record .levelno == logging .WARNING and "byo-llm" in record .getMessage ()
750- ]
751-
752-
753743@pytest .mark .parametrize (
754744 "lcs" ,
755745 [
@@ -758,43 +748,29 @@ def _byo_llm_deprecation_warnings(caplog: pytest.LogCaptureFixture) -> list[str]
758748 {},
759749 ],
760750)
761- def test_synthesize_default_path_warns_and_keeps_conditional_openai (
762- caplog : pytest . LogCaptureFixture , lcs : dict [str , Any ]
751+ def test_synthesize_default_path_keeps_conditional_openai (
752+ lcs : dict [str , Any ],
763753) -> None :
764- """default or omitted baseline keeps the OpenAI row and warns naming byo-llm."""
765- with caplog .at_level (
766- "WARNING" , logger = "lightspeed_stack.llama_stack_configuration"
767- ):
768- result = synthesize_configuration (lcs )
754+ """default or omitted baseline keeps the OpenAI row."""
755+ result = synthesize_configuration (lcs )
769756 openai_entries = _openai_inference_entries (result )
770757 assert len (openai_entries ) == 1
771758 assert openai_entries [0 ]["provider_id" ] == OPENAI_CONDITIONAL_PROVIDER_ID
772759 ids = [entry ["provider_id" ] for entry in _inference_entries (result )]
773760 assert "sentence-transformers" in ids
774- warnings = _byo_llm_deprecation_warnings (caplog )
775- assert len (warnings ) == 1
776- assert "byo-llm" in warnings [0 ]
777761
778762
779- def test_synthesize_byo_llm_strips_openai_without_warn (
780- caplog : pytest .LogCaptureFixture ,
781- ) -> None :
782- """byo-llm drops the built-in OpenAI row, keeps the embedder, and does not warn."""
763+ def test_synthesize_byo_llm_strips_openai () -> None :
764+ """byo-llm drops the built-in OpenAI row and keeps the embedder."""
783765 lcs = {"llama_stack" : {"config" : {"baseline" : "byo-llm" }}}
784- with caplog .at_level (
785- "WARNING" , logger = "lightspeed_stack.llama_stack_configuration"
786- ):
787- result = synthesize_configuration (lcs )
766+ result = synthesize_configuration (lcs )
788767 assert _openai_inference_entries (result ) == []
789768 ids = [entry ["provider_id" ] for entry in _inference_entries (result )]
790769 assert ids == ["sentence-transformers" ]
791770 assert "model-context-protocol" in _tool_runtime_ids (result )
792- assert _byo_llm_deprecation_warnings (caplog ) == []
793771
794772
795- def test_synthesize_byo_llm_with_vllm_appends_without_openai (
796- caplog : pytest .LogCaptureFixture ,
797- ) -> None :
773+ def test_synthesize_byo_llm_with_vllm_appends_without_openai () -> None :
798774 """byo-llm + high-level vLLM appends vLLM and does not restore OpenAI."""
799775 lcs = {
800776 "llama_stack" : {"config" : {"baseline" : "byo-llm" }},
@@ -808,10 +784,7 @@ def test_synthesize_byo_llm_with_vllm_appends_without_openai(
808784 ]
809785 },
810786 }
811- with caplog .at_level (
812- "WARNING" , logger = "lightspeed_stack.llama_stack_configuration"
813- ):
814- result = synthesize_configuration (lcs )
787+ result = synthesize_configuration (lcs )
815788 assert _openai_inference_entries (result ) == []
816789 vllm = next (
817790 entry for entry in _inference_entries (result ) if entry ["provider_id" ] == "vllm"
@@ -820,34 +793,25 @@ def test_synthesize_byo_llm_with_vllm_appends_without_openai(
820793 assert "sentence-transformers" in [
821794 entry ["provider_id" ] for entry in _inference_entries (result )
822795 ]
823- assert _byo_llm_deprecation_warnings (caplog ) == []
824796
825797
826- def test_synthesize_byo_llm_with_openai_appends_one_row (
827- caplog : pytest .LogCaptureFixture ,
828- ) -> None :
829- """byo-llm + high-level openai appends a single openai row and does not warn."""
798+ def test_synthesize_byo_llm_with_openai_appends_one_row () -> None :
799+ """byo-llm + high-level openai appends a single openai row."""
830800 lcs = {
831801 "llama_stack" : {"config" : {"baseline" : "byo-llm" }},
832802 "inference" : {
833803 "providers" : [{"type" : "openai" , "api_key_env" : "OPENAI_API_KEY" }]
834804 },
835805 }
836- with caplog .at_level (
837- "WARNING" , logger = "lightspeed_stack.llama_stack_configuration"
838- ):
839- result = synthesize_configuration (lcs )
806+ result = synthesize_configuration (lcs )
840807 openai_entries = _openai_inference_entries (result )
841808 assert len (openai_entries ) == 1
842809 assert openai_entries [0 ]["provider_id" ] == "openai"
843810 assert openai_entries [0 ]["config" ]["api_key" ] == "${env.OPENAI_API_KEY}"
844- assert _byo_llm_deprecation_warnings (caplog ) == []
845811
846812
847- def test_synthesize_empty_baseline_does_not_warn_byo_llm (
848- caplog : pytest .LogCaptureFixture ,
849- ) -> None :
850- """baseline: empty is unchanged: no strip, no byo-llm WARN."""
813+ def test_synthesize_empty_baseline_does_not_strip_openai () -> None :
814+ """baseline: empty is unchanged: no OpenAI strip."""
851815 lcs = {
852816 "llama_stack" : {
853817 "config" : {
@@ -856,18 +820,12 @@ def test_synthesize_empty_baseline_does_not_warn_byo_llm(
856820 }
857821 }
858822 }
859- with caplog .at_level (
860- "WARNING" , logger = "lightspeed_stack.llama_stack_configuration"
861- ):
862- result = synthesize_configuration (lcs )
823+ result = synthesize_configuration (lcs )
863824 assert result == {"version" : 2 , "apis" : ["inference" ]}
864- assert _byo_llm_deprecation_warnings (caplog ) == []
865825
866826
867- def test_synthesize_profile_ignores_byo_llm_and_does_not_warn (
868- tmp_path : Path , caplog : pytest .LogCaptureFixture
869- ) -> None :
870- """profile: wins over baseline: byo-llm; no strip and no deprecation WARN."""
827+ def test_synthesize_profile_ignores_byo_llm (tmp_path : Path ) -> None :
828+ """profile: wins over baseline: byo-llm; no OpenAI strip."""
871829 profile = {
872830 "version" : 2 ,
873831 "apis" : ["inference" ],
@@ -891,15 +849,11 @@ def test_synthesize_profile_ignores_byo_llm_and_does_not_warn(
891849 }
892850 }
893851 }
894- with caplog .at_level (
895- "WARNING" , logger = "lightspeed_stack.llama_stack_configuration"
896- ):
897- result = synthesize_configuration (lcs , config_file_dir = str (tmp_path ))
852+ result = synthesize_configuration (lcs , config_file_dir = str (tmp_path ))
898853 assert result ["marker" ] == "from-profile"
899854 openai_entries = _openai_inference_entries (result )
900855 assert len (openai_entries ) == 1
901856 assert openai_entries [0 ]["provider_id" ] == "openai"
902- assert _byo_llm_deprecation_warnings (caplog ) == []
903857
904858
905859def test_synthesize_loads_profile_relative_to_config_dir (tmp_path : Path ) -> None :
0 commit comments