diff --git a/python/tests/integration/agents/chat_completion_agent/test_chat_completion_agent_integration.py b/python/tests/integration/agents/chat_completion_agent/test_chat_completion_agent_integration.py index 5f8920c397..7e1c276878 100644 --- a/python/tests/integration/agents/chat_completion_agent/test_chat_completion_agent_integration.py +++ b/python/tests/integration/agents/chat_completion_agent/test_chat_completion_agent_integration.py @@ -15,6 +15,8 @@ from semantic_kernel.contents.text_content import TextContent from semantic_kernel.functions import kernel_function from tests.integration.agents.agent_test_base import AgentTestBase +openai_api_key_skip = pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401).") + class WeatherPlugin: """A sample Mock weather plugin.""" @@ -57,7 +59,12 @@ class TestChatCompletionAgentIntegration: # region Simple 'Hello' messages tests - @pytest.mark.parametrize("chat_completion_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "chat_completion_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_get_response(self, chat_completion_agent: ChatCompletionAgent, agent_test_base: AgentTestBase): """Test get response of the agent.""" response = await agent_test_base.get_response_with_retry(chat_completion_agent, messages="Hello") @@ -65,7 +72,12 @@ class TestChatCompletionAgentIntegration: assert response.message.role == AuthorRole.ASSISTANT assert response.message.content is not None - @pytest.mark.parametrize("chat_completion_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "chat_completion_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_get_response_with_thread( self, chat_completion_agent: ChatCompletionAgent, agent_test_base: AgentTestBase ): @@ -85,7 +97,12 @@ class TestChatCompletionAgentIntegration: assert response.message.content is not None await thread.delete() if thread else None - @pytest.mark.parametrize("chat_completion_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "chat_completion_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_invoke(self, chat_completion_agent: ChatCompletionAgent, agent_test_base: AgentTestBase): """Test invoke of the agent.""" responses = await agent_test_base.get_invoke_with_retry(chat_completion_agent, messages="Hello") @@ -100,7 +117,12 @@ class TestChatCompletionAgentIntegration: assert usage.prompt_tokens > 0 assert usage.completion_tokens > 0 - @pytest.mark.parametrize("chat_completion_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "chat_completion_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_invoke_with_thread(self, chat_completion_agent: ChatCompletionAgent, agent_test_base: AgentTestBase): """Test invoke of the agent with a thread.""" thread = None @@ -119,7 +141,12 @@ class TestChatCompletionAgentIntegration: await thread.delete() if thread else None - @pytest.mark.parametrize("chat_completion_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "chat_completion_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_invoke_stream(self, chat_completion_agent: ChatCompletionAgent, agent_test_base: AgentTestBase): """Test invoke stream of the agent.""" responses = await agent_test_base.get_invoke_stream_with_retry(chat_completion_agent, messages="Hello") @@ -134,7 +161,12 @@ class TestChatCompletionAgentIntegration: assert usage.prompt_tokens > 0 assert usage.completion_tokens > 0 - @pytest.mark.parametrize("chat_completion_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "chat_completion_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_invoke_stream_with_thread( self, chat_completion_agent: ChatCompletionAgent, agent_test_base: AgentTestBase ): @@ -163,7 +195,7 @@ class TestChatCompletionAgentIntegration: "chat_completion_agent", [ ("azure", {"enable_kernel_function": True}), - ("openai", {"enable_kernel_function": True}), + pytest.param(("openai", {"enable_kernel_function": True}), marks=openai_api_key_skip), ], indirect=["chat_completion_agent"], ids=["azure-function-calling", "openai-function-calling"], @@ -185,7 +217,7 @@ class TestChatCompletionAgentIntegration: "chat_completion_agent", [ ("azure", {"enable_kernel_function": True}), - ("openai", {"enable_kernel_function": True}), + pytest.param(("openai", {"enable_kernel_function": True}), marks=openai_api_key_skip), ], indirect=["chat_completion_agent"], ids=["azure-function-calling", "openai-function-calling"], @@ -209,7 +241,7 @@ class TestChatCompletionAgentIntegration: "chat_completion_agent", [ ("azure", {"enable_kernel_function": True}), - ("openai", {"enable_kernel_function": True}), + pytest.param(("openai", {"enable_kernel_function": True}), marks=openai_api_key_skip), ], indirect=["chat_completion_agent"], ids=["azure-function-calling", "openai-function-calling"], @@ -240,7 +272,10 @@ class TestChatCompletionAgentIntegration: ("azure", {"enable_kernel_function": True}), pytest.param( ("openai", {"enable_kernel_function": True}), - marks=pytest.mark.xfail(reason="OpenAI service raise error for downloading image from URL"), + marks=[ + pytest.mark.xfail(reason="OpenAI service raise error for downloading image from URL"), + openai_api_key_skip, + ], ), ], indirect=["chat_completion_agent"], diff --git a/python/tests/integration/agents/openai_responses_agent/test_openai_responses_agent_integration.py b/python/tests/integration/agents/openai_responses_agent/test_openai_responses_agent_integration.py index a30310a398..57e0cf784b 100644 --- a/python/tests/integration/agents/openai_responses_agent/test_openai_responses_agent_integration.py +++ b/python/tests/integration/agents/openai_responses_agent/test_openai_responses_agent_integration.py @@ -15,6 +15,8 @@ from semantic_kernel.contents.text_content import TextContent from semantic_kernel.functions import kernel_function from tests.integration.agents.agent_test_base import AgentTestBase +openai_api_key_skip = pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401).") + class WeatherPlugin: """A sample Mock weather plugin.""" @@ -99,7 +101,12 @@ class TestOpenAIResponsesAgentIntegration: # region Simple 'Hello' messages tests - @pytest.mark.parametrize("responses_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "responses_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_get_response(self, responses_agent: OpenAIResponsesAgent, agent_test_base: AgentTestBase): """Test get response of the agent.""" response = await agent_test_base.get_response_with_retry(responses_agent, messages="Hello") @@ -108,7 +115,12 @@ class TestOpenAIResponsesAgentIntegration: assert response.message.content is not None assert "thread_id" in response.message.metadata - @pytest.mark.parametrize("responses_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "responses_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_get_response_with_thread( self, responses_agent: OpenAIResponsesAgent, agent_test_base: AgentTestBase ): @@ -127,7 +139,12 @@ class TestOpenAIResponsesAgentIntegration: await thread.delete() if thread else None - @pytest.mark.parametrize("responses_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "responses_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_invoke(self, responses_agent: OpenAIResponsesAgent, agent_test_base: AgentTestBase): """Test invoke of the agent.""" async for response in responses_agent.invoke(messages="Hello"): @@ -135,7 +152,12 @@ class TestOpenAIResponsesAgentIntegration: assert response.message.role == AuthorRole.ASSISTANT assert response.message.content is not None - @pytest.mark.parametrize("responses_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "responses_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_invoke_with_thread(self, responses_agent: OpenAIResponsesAgent, agent_test_base: AgentTestBase): """Test invoke of the agent with a thread.""" thread = None @@ -154,7 +176,12 @@ class TestOpenAIResponsesAgentIntegration: await thread.delete() if thread else None - @pytest.mark.parametrize("responses_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "responses_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_invoke_stream(self, responses_agent: OpenAIResponsesAgent, agent_test_base: AgentTestBase): """Test invoke stream of the agent.""" responses = await agent_test_base.get_invoke_stream_with_retry(responses_agent, messages="Hello") @@ -164,7 +191,12 @@ class TestOpenAIResponsesAgentIntegration: assert response.message.role == AuthorRole.ASSISTANT assert response.message.content is not None - @pytest.mark.parametrize("responses_agent", ["azure", "openai"], indirect=True, ids=["azure", "openai"]) + @pytest.mark.parametrize( + "responses_agent", + ["azure", pytest.param("openai", marks=openai_api_key_skip)], + indirect=True, + ids=["azure", "openai"], + ) async def test_invoke_stream_with_thread( self, responses_agent: OpenAIResponsesAgent, agent_test_base: AgentTestBase ): @@ -193,7 +225,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ # Azure OpenAI Responses API doesn't yet support the web search tool - ("openai", {"enable_web_search": True}), + pytest.param(("openai", {"enable_web_search": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["openai-web-search-get-response"], @@ -215,7 +247,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ ("azure", {"enable_file_search": True}), - ("openai", {"enable_file_search": True}), + pytest.param(("openai", {"enable_file_search": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["azure-file-search-get-response", "openai-file-search-get-response"], @@ -234,7 +266,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ ("azure", {"enable_file_search": True}), - ("openai", {"enable_file_search": True}), + pytest.param(("openai", {"enable_file_search": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["azure-file-search-invoke", "openai-file-search-invoke"], @@ -253,7 +285,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ ("azure", {"enable_file_search": True}), - ("openai", {"enable_file_search": True}), + pytest.param(("openai", {"enable_file_search": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["azure-file-search-invoke-stream", "openai-file-search-invoke-stream"], @@ -278,7 +310,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ ("azure", {"enable_kernel_function": True}), - ("openai", {"enable_kernel_function": True}), + pytest.param(("openai", {"enable_kernel_function": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["azure-function-calling-get-response", "openai-function-calling-get-response"], @@ -300,7 +332,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ ("azure", {"enable_kernel_function": True}), - ("openai", {"enable_kernel_function": True}), + pytest.param(("openai", {"enable_kernel_function": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["azure-function-calling-invoke", "openai-function-calling-invoke"], @@ -322,7 +354,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ ("azure", {"enable_kernel_function": True}), - ("openai", {"enable_kernel_function": True}), + pytest.param(("openai", {"enable_kernel_function": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["azure-function-calling-invoke-stream", "openai-function-calling-invoke-stream"], @@ -349,7 +381,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ ("azure", {"enable_structured_outputs": True}), - ("openai", {"enable_structured_outputs": True}), + pytest.param(("openai", {"enable_structured_outputs": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["azure-structured-outputs-get-response", "openai-structured-outputs-get-response"], @@ -371,7 +403,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ ("azure", {"enable_structured_outputs": True}), - ("openai", {"enable_structured_outputs": True}), + pytest.param(("openai", {"enable_structured_outputs": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["azure-structured-outputs-invoke", "openai-structured-outputs-invoke"], @@ -395,7 +427,7 @@ class TestOpenAIResponsesAgentIntegration: "responses_agent", [ ("azure", {"enable_structured_outputs": True}), - ("openai", {"enable_structured_outputs": True}), + pytest.param(("openai", {"enable_structured_outputs": True}), marks=openai_api_key_skip), ], indirect=["responses_agent"], ids=["azure-structured-outputs-invoke-stream", "openai-structured-outputs-invoke-stream"], diff --git a/python/tests/integration/audio_to_text/test_audio_to_text.py b/python/tests/integration/audio_to_text/test_audio_to_text.py index d51d5fc845..7b4b545548 100644 --- a/python/tests/integration/audio_to_text/test_audio_to_text.py +++ b/python/tests/integration/audio_to_text/test_audio_to_text.py @@ -15,6 +15,7 @@ pytestmark = pytest.mark.parametrize( "openai", AudioContent.from_audio_file(os.path.join(os.path.dirname(__file__), "../../", "assets/sample_audio.mp3")), ["hi", "how", "are", "you", "doing"], + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai", ), pytest.param( diff --git a/python/tests/integration/completions/test_chat_completion_with_function_calling.py b/python/tests/integration/completions/test_chat_completion_with_function_calling.py index 93fcea5491..b6d66307b4 100644 --- a/python/tests/integration/completions/test_chat_completion_with_function_calling.py +++ b/python/tests/integration/completions/test_chat_completion_with_function_calling.py @@ -75,6 +75,7 @@ pytestmark = pytest.mark.parametrize( ] ], {"test_type": FunctionChoiceTestTypes.AUTO}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai_tool_call_auto", ), pytest.param( @@ -97,6 +98,7 @@ pytestmark = pytest.mark.parametrize( ] ], {"test_type": FunctionChoiceTestTypes.NON_AUTO}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai_tool_call_non_auto", ), pytest.param( @@ -123,6 +125,7 @@ pytestmark = pytest.mark.parametrize( ], ], {"test_type": FunctionChoiceTestTypes.FLOW}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai_tool_call_flow", ), pytest.param( @@ -141,6 +144,7 @@ pytestmark = pytest.mark.parametrize( ] ], {"test_type": FunctionChoiceTestTypes.AUTO}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai_tool_call_auto_complex_return_type", ), # endregion diff --git a/python/tests/integration/completions/test_chat_completion_with_image_input_text_output.py b/python/tests/integration/completions/test_chat_completion_with_image_input_text_output.py index 983832222c..673f1e46d8 100644 --- a/python/tests/integration/completions/test_chat_completion_with_image_input_text_output.py +++ b/python/tests/integration/completions/test_chat_completion_with_image_input_text_output.py @@ -49,6 +49,7 @@ pytestmark = pytest.mark.parametrize( ChatMessageContent(role=AuthorRole.USER, items=[TextContent(text="Where was it made?")]), ], {}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai_image_input_uri", ), pytest.param( @@ -67,6 +68,7 @@ pytestmark = pytest.mark.parametrize( ChatMessageContent(role=AuthorRole.USER, items=[TextContent(text="Where was it made?")]), ], {}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai_image_input_file", ), pytest.param( diff --git a/python/tests/integration/completions/test_chat_completions.py b/python/tests/integration/completions/test_chat_completions.py index ca163f8a9e..dc84a19cc4 100644 --- a/python/tests/integration/completions/test_chat_completions.py +++ b/python/tests/integration/completions/test_chat_completions.py @@ -49,6 +49,7 @@ pytestmark = pytest.mark.parametrize( ChatMessageContent(role=AuthorRole.USER, items=[TextContent(text="How are you today?")]), ], {}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai_text_input", ), pytest.param( @@ -59,6 +60,7 @@ pytestmark = pytest.mark.parametrize( ChatMessageContent(role=AuthorRole.USER, items=[TextContent(text="How are you today?")]), ], {}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai_json_schema_response_format", ), # endregion diff --git a/python/tests/integration/completions/test_conversation_summary_plugin.py b/python/tests/integration/completions/test_conversation_summary_plugin.py index 8e466d6d47..2c2eef1e75 100644 --- a/python/tests/integration/completions/test_conversation_summary_plugin.py +++ b/python/tests/integration/completions/test_conversation_summary_plugin.py @@ -1,5 +1,6 @@ # Copyright (c) Microsoft. All rights reserved. +import pytest import semantic_kernel.connectors.ai.open_ai as sk_oai from semantic_kernel.connectors.ai.prompt_execution_settings import PromptExecutionSettings @@ -47,6 +48,7 @@ Jane: That's a good idea. Let me see if I can find one. Maybe Lorem Ipsum? John: Yeah, that's a good idea.""" +@pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401).") async def test_azure_summarize_conversation_using_plugin(kernel): service_id = "text_completion" diff --git a/python/tests/integration/completions/test_text_completion.py b/python/tests/integration/completions/test_text_completion.py index 65802a505e..ff6613bd5b 100644 --- a/python/tests/integration/completions/test_text_completion.py +++ b/python/tests/integration/completions/test_text_completion.py @@ -49,6 +49,7 @@ pytestmark = pytest.mark.parametrize( {}, ["Repeat the word Hello once"], {}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai_text_completion", ), pytest.param( diff --git a/python/tests/integration/cross_language/test_cross_language.py b/python/tests/integration/cross_language/test_cross_language.py index 72aa0a16ba..285d39650a 100644 --- a/python/tests/integration/cross_language/test_cross_language.py +++ b/python/tests/integration/cross_language/test_cross_language.py @@ -26,6 +26,8 @@ logger = logging.getLogger(__name__) OPENAI_MODEL_ID = "gpt-4.1-nano" +openai_api_key_skip = pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401).") + # region Test Prompts simple_prompt = "Can you help me tell the time in Seattle right now?" @@ -188,6 +190,7 @@ class City: # region Test Prompt With Chat Roles +@openai_api_key_skip @pytest.mark.parametrize( "is_inline, is_streaming, template_format, prompt", [ @@ -299,6 +302,7 @@ async def test_prompt_with_chat_roles( # region Test Prompt With Complex Objects +@openai_api_key_skip @pytest.mark.parametrize( "is_inline, is_streaming, template_format, prompt", [ @@ -411,6 +415,7 @@ async def test_prompt_with_complex_objects( # region Test Prompt With Helper Functions +@openai_api_key_skip @pytest.mark.parametrize( "is_inline, is_streaming, template_format, prompt", [ @@ -497,6 +502,7 @@ async def test_prompt_with_helper_functions( # region Test Prompt With Simple Variable +@openai_api_key_skip @pytest.mark.parametrize( "is_inline, is_streaming, template_format, prompt", [ @@ -562,6 +568,7 @@ async def test_prompt_with_simple_variable( # region Test Simple Prompt +@openai_api_key_skip @pytest.mark.parametrize( "is_inline, is_streaming, template_format, prompt", [ @@ -626,6 +633,7 @@ async def test_simple_prompt( # region Test YAML Prompts +@openai_api_key_skip @pytest.mark.parametrize( "is_streaming, prompt_path, expected_result_path", [ diff --git a/python/tests/integration/embeddings/test_embedding_service.py b/python/tests/integration/embeddings/test_embedding_service.py index f061cf8442..89ff98b833 100644 --- a/python/tests/integration/embeddings/test_embedding_service.py +++ b/python/tests/integration/embeddings/test_embedding_service.py @@ -22,6 +22,7 @@ pytestmark = pytest.mark.parametrize( "openai", {}, 1536, # text-embedding-ada-002 doesn't support custom output dimensionality + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai", ), pytest.param( diff --git a/python/tests/integration/embeddings/test_embedding_service_with_memory.py b/python/tests/integration/embeddings/test_embedding_service_with_memory.py index 07b5b6d3be..25867f5274 100644 --- a/python/tests/integration/embeddings/test_embedding_service_with_memory.py +++ b/python/tests/integration/embeddings/test_embedding_service_with_memory.py @@ -23,6 +23,7 @@ pytestmark = pytest.mark.parametrize( pytest.param( "openai", {}, + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai", ), pytest.param( diff --git a/python/tests/integration/text_to_audio/test_text_to_audio.py b/python/tests/integration/text_to_audio/test_text_to_audio.py index f4dfe1f81c..c368110a0d 100644 --- a/python/tests/integration/text_to_audio/test_text_to_audio.py +++ b/python/tests/integration/text_to_audio/test_text_to_audio.py @@ -13,6 +13,7 @@ pytestmark = pytest.mark.parametrize( pytest.param( "openai", "Hello World!", + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai", ), pytest.param( diff --git a/python/tests/integration/text_to_image/test_text_to_image.py b/python/tests/integration/text_to_image/test_text_to_image.py index 498e8a8278..f05b6156bd 100644 --- a/python/tests/integration/text_to_image/test_text_to_image.py +++ b/python/tests/integration/text_to_image/test_text_to_image.py @@ -12,6 +12,7 @@ pytestmark = pytest.mark.parametrize( pytest.param( "openai", "A cute tuxedo cat driving a race car.", + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), id="openai", ), pytest.param( diff --git a/python/tests/samples/test_concepts.py b/python/tests/samples/test_concepts.py index e5a286d76e..842a3e1afe 100644 --- a/python/tests/samples/test_concepts.py +++ b/python/tests/samples/test_concepts.py @@ -77,17 +77,23 @@ concepts = [ semantic_caching, [], id="semantic_caching", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( simple_chatbot, ["Why is the sky blue in one sentence?", "exit"], id="simple_chatbot", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( simple_chatbot_streaming, @@ -133,9 +139,12 @@ concepts = [ auto_function_invoke_filters, ["What is 3+3?", "exit"], id="auto_function_invoke_filters", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( function_invocation_filters, @@ -157,18 +166,24 @@ concepts = [ prompt_filters, ["What is the fastest animal?", "exit"], id="prompt_filters", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( retry_with_different_model, [], id="retry_with_different_model", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, - reason="Not running completion samples.", - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, + reason="Not running completion samples.", + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( kernel_arguments, @@ -182,25 +197,34 @@ concepts = [ grounded, [], id="grounded", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( openai_function_calling_with_custom_plugin, [], id="openai_function_calling_with_custom_plugin", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( plugins_from_dir, [], id="plugins_from_dir", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( azure_chat_gpt_api_handlebars, @@ -230,33 +254,50 @@ concepts = [ configuring_prompts, ["What is my name?", "exit"], id="configuring_prompts", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( load_yaml_prompt, [], id="load_yaml_prompt", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( template_language, [], id="template_language", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( simple_memory, [], id="simple_memory", - marks=pytest.mark.skipif(os.getenv(MEMORY_CONCEPT_SAMPLE, None) is None, reason="Not running memory samples."), + marks=[ + pytest.mark.skipif(os.getenv(MEMORY_CONCEPT_SAMPLE, None) is None, reason="Not running memory samples."), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], + ), + param( + rag_with_vector_collection, + [], + id="rag_with_vector_collection", + marks=pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), ), - param(rag_with_vector_collection, [], id="rag_with_vector_collection"), param( custom_service_selector, [], @@ -269,17 +310,23 @@ concepts = [ function_defined_in_json_prompt, ["What is 3+3?", "exit"], id="function_defined_in_json_prompt", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( function_defined_in_yaml_prompt, ["What is 3+3?", "exit"], id="function_defined_in_yaml_prompt", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( step1_chat_completion_agent_simple, @@ -352,25 +399,34 @@ concepts = [ image_generation, [], id="image_generation", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( text_completion, [], id="text_completion", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( text_embedding_generation, [], id="text_embedding_generation", - marks=pytest.mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + pytest.mark.skipif( + os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." + ), + pytest.mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), ] diff --git a/python/tests/samples/test_getting_started.py b/python/tests/samples/test_getting_started.py index ff10023e15..c4cd413884 100644 --- a/python/tests/samples/test_getting_started.py +++ b/python/tests/samples/test_getting_started.py @@ -81,15 +81,17 @@ notebooks = [ ), param( "09-multiple-results-per-prompt.ipynb", - marks=mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + mark.skipif(os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples."), + mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), param( "10-streaming-completions.ipynb", - marks=mark.skipif( - os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples." - ), + marks=[ + mark.skipif(os.getenv(COMPLETIONS_CONCEPT_SAMPLE, None) is None, reason="Not running completion samples."), + mark.skip(reason="Temporarily disabled due to invalid OpenAI API key (HTTP 401)."), + ], ), ]