diff --git a/sdk/ai/azure-ai-projects/assets.json b/sdk/ai/azure-ai-projects/assets.json index d620327691f2..219af81a83e0 100644 --- a/sdk/ai/azure-ai-projects/assets.json +++ b/sdk/ai/azure-ai-projects/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/ai/azure-ai-projects", - "Tag": "python/ai/azure-ai-projects_4160165ae8" + "Tag": "python/ai/azure-ai-projects_0c9b00044b" } diff --git a/sdk/ai/azure-ai-projects/samples/agents/assets/.gitattributes b/sdk/ai/azure-ai-projects/samples/agents/assets/.gitattributes new file mode 100644 index 000000000000..878545b8b1cb --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/assets/.gitattributes @@ -0,0 +1,13 @@ +# Force LF line endings for test files to ensure consistent binary representation +# across Windows and Linux platforms. +# +# These files are read and sent as binary REST API request payloads in tests. +# Without consistent line endings, the binary content differs between platforms, +# causing recorded test traffic to be inconsistent and test playback to fail. +# +# By enforcing LF endings, the binary representation remains identical regardless +# of the platform where tests are executed. + +*.md text eol=lf +*.csv text eol=lf +*.jsonl text eol=lf diff --git a/sdk/ai/azure-ai-projects/tests/conftest.py b/sdk/ai/azure-ai-projects/tests/conftest.py index 5a009ec7c80d..ad54a729211e 100644 --- a/sdk/ai/azure-ai-projects/tests/conftest.py +++ b/sdk/ai/azure-ai-projects/tests/conftest.py @@ -3,6 +3,14 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ + +# Register MIME types before any other imports to ensure consistent Content-Type detection +# across Windows, macOS, and Linux when uploading files in tests +import mimetypes + +mimetypes.add_type("text/csv", ".csv") +mimetypes.add_type("text/markdown", ".md") + import os import pytest from dotenv import load_dotenv, find_dotenv @@ -100,9 +108,6 @@ def sanitize_url_paths(): sanitize_url_paths() - # Normalize Content-Type for CSV files in multipart form-data (varies by OS/Python version) - add_general_string_sanitizer(target="Content-Type: text/csv", value="Content-Type: application/vnd.ms-excel") - # Sanitize API key from service response (this includes Application Insights connection string) add_body_key_sanitizer(json_path="credentials.key", value="sanitized-api-key") diff --git a/sdk/ai/azure-ai-projects/tests/samples/samples_report.csv b/sdk/ai/azure-ai-projects/tests/samples/samples_report.csv new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py index d0c4db50142c..9de90603c0b6 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -165,8 +165,6 @@ def _get_tools_sample_paths(): "sample_agent_browser_automation.py", "sample_agent_code_interpreter.py", "sample_agent_fabric.py", - "sample_agent_file_search.py", - "sample_agent_file_search_in_stream.py", "sample_agent_mcp_with_project_connection.py", "sample_agent_memory_search.py", "sample_agent_openapi_with_project_connection.py", @@ -192,8 +190,6 @@ def _get_tools_sample_paths_async(): # Skip async samples that are not yet ready for testing tools_samples_to_skip = [ "sample_agent_code_interpreter_async.py", - "sample_agent_file_search_async.py", - "sample_agent_file_search_in_stream_async.py", "sample_agent_mcp_with_project_connection_async.py", "sample_agent_memory_search_async.py", ]