diff --git a/dotnet/test/Harness/E2ETestContext.cs b/dotnet/test/Harness/E2ETestContext.cs index 86c1dd3..dcecc04 100644 --- a/dotnet/test/Harness/E2ETestContext.cs +++ b/dotnet/test/Harness/E2ETestContext.cs @@ -70,12 +70,9 @@ private static string GetCliPath(string repoRoot) public async Task ConfigureForTestAsync(string testFile, [CallerMemberName] string? testName = null) { - // Convert PascalCase method names to snake_case matching snapshot filenames - // e.g., Should_Create_A_Session_With_AvailableTools -> should_create_a_session_with_availableTools - var sanitizedName = Regex.Replace(testName!, @"_([A-Z])([A-Z]+)(_|$)", m => - "_" + char.ToLowerInvariant(m.Groups[1].Value[0]) + m.Groups[2].Value.ToLowerInvariant() + m.Groups[3].Value); - sanitizedName = Regex.Replace(sanitizedName, @"(^|_)([A-Z])(?=[a-z]|_|$)", m => - m.Groups[1].Value + char.ToLowerInvariant(m.Groups[2].Value[0])); + // Convert test method names to lowercase snake_case for snapshot filenames + // to avoid case collisions on case-insensitive filesystems (macOS/Windows) + var sanitizedName = Regex.Replace(testName!, @"[^a-zA-Z0-9]", "_").ToLowerInvariant(); var snapshotPath = Path.Combine(_repoRoot, "test", "snapshots", testFile, $"{sanitizedName}.yaml"); await _proxy.ConfigureAsync(snapshotPath, WorkDir); } diff --git a/go/e2e/testharness/context.go b/go/e2e/testharness/context.go index b56f8f5..b8cc3a3 100644 --- a/go/e2e/testharness/context.go +++ b/go/e2e/testharness/context.go @@ -99,7 +99,7 @@ func (c *TestContext) ConfigureForTest(t *testing.T) { parts := strings.SplitN(testName, "/", 2) testFile := strings.ToLower(strings.TrimPrefix(parts[0], "Test")) - sanitizedName := regexp.MustCompile(`[^a-zA-Z0-9]`).ReplaceAllString(parts[1], "_") + sanitizedName := strings.ToLower(regexp.MustCompile(`[^a-zA-Z0-9]`).ReplaceAllString(parts[1], "_")) snapshotPath := filepath.Join("..", "..", "test", "snapshots", testFile, sanitizedName+".yaml") absSnapshotPath, err := filepath.Abs(snapshotPath) diff --git a/nodejs/test/e2e/harness/sdkTestContext.ts b/nodejs/test/e2e/harness/sdkTestContext.ts index 9d0ef5e..abb0a99 100644 --- a/nodejs/test/e2e/harness/sdkTestContext.ts +++ b/nodejs/test/e2e/harness/sdkTestContext.ts @@ -81,7 +81,7 @@ function getTrafficCapturePath(testContext: TestContext): string { } const testFileName = basename(testFilePath, suffix); - const taskNameAsFilename = testContext.task.name.replace(/[^a-z0-9]/gi, "_"); + const taskNameAsFilename = testContext.task.name.replace(/[^a-z0-9]/gi, "_").toLowerCase(); return join(SNAPSHOTS_DIR, testFileName, `${taskNameAsFilename}.yaml`); } diff --git a/python/e2e/testharness/context.py b/python/e2e/testharness/context.py index ed1ca72..b1150a0 100644 --- a/python/e2e/testharness/context.py +++ b/python/e2e/testharness/context.py @@ -97,7 +97,7 @@ async def configure_for_test(self, test_file: str, test_name: str): test_file: The test file name (e.g., "session" from "test_session.py") test_name: The test name (e.g., "should_have_stateful_conversation") """ - sanitized_name = re.sub(r"[^a-zA-Z0-9]", "_", test_name) + sanitized_name = re.sub(r"[^a-zA-Z0-9]", "_", test_name).lower() snapshot_path = SNAPSHOTS_DIR / test_file / f"{sanitized_name}.yaml" abs_snapshot_path = str(snapshot_path.resolve()) diff --git a/test/snapshots/ask/should_invoke_onEvent_callback_for_each_event.yaml b/test/snapshots/ask/should_invoke_onevent_callback_for_each_event.yaml similarity index 100% rename from test/snapshots/ask/should_invoke_onEvent_callback_for_each_event.yaml rename to test/snapshots/ask/should_invoke_onevent_callback_for_each_event.yaml diff --git a/test/snapshots/combinedconfiguration/accept_MCP_servers_and_custom_agents.yaml b/test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml similarity index 100% rename from test/snapshots/combinedconfiguration/accept_MCP_servers_and_custom_agents.yaml rename to test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml diff --git a/test/snapshots/mcp-and-agents/should_accept_both_MCP_servers_and_custom_agents.yaml b/test/snapshots/mcp-and-agents/should_accept_both_MCP_servers_and_custom_agents.yaml deleted file mode 100644 index 60d1ead..0000000 --- a/test/snapshots/mcp-and-agents/should_accept_both_MCP_servers_and_custom_agents.yaml +++ /dev/null @@ -1,10 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: What is 7+7? - - role: assistant - content: 7 + 7 = 14 diff --git a/test/snapshots/mcpservers/accept_MCP_server_config_on_create.yaml b/test/snapshots/mcpservers/accept_MCP_server_config_on_create.yaml deleted file mode 100644 index 9fe2fcd..0000000 --- a/test/snapshots/mcpservers/accept_MCP_server_config_on_create.yaml +++ /dev/null @@ -1,10 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: What is 2+2? - - role: assistant - content: 2 + 2 = 4 diff --git a/test/snapshots/mcpservers/accept_MCP_server_config_on_resume.yaml b/test/snapshots/mcpservers/accept_MCP_server_config_on_resume.yaml deleted file mode 100644 index 82c9917..0000000 --- a/test/snapshots/mcpservers/accept_MCP_server_config_on_resume.yaml +++ /dev/null @@ -1,14 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: What is 1+1? - - role: assistant - content: 1 + 1 = 2 - - role: user - content: What is 3+3? - - role: assistant - content: 3 + 3 = 6 diff --git a/test/snapshots/mcp-and-agents/should_accept_MCP_server_configuration_on_session_create.yaml b/test/snapshots/mcpservers/accept_mcp_server_config_on_create.yaml similarity index 100% rename from test/snapshots/mcp-and-agents/should_accept_MCP_server_configuration_on_session_create.yaml rename to test/snapshots/mcpservers/accept_mcp_server_config_on_create.yaml diff --git a/test/snapshots/mcp-and-agents/should_accept_MCP_server_configuration_on_session_resume.yaml b/test/snapshots/mcpservers/accept_mcp_server_config_on_resume.yaml similarity index 100% rename from test/snapshots/mcp-and-agents/should_accept_MCP_server_configuration_on_session_resume.yaml rename to test/snapshots/mcpservers/accept_mcp_server_config_on_resume.yaml diff --git a/test/snapshots/permissions/should_receive_toolCallId_in_permission_requests.yaml b/test/snapshots/permissions/should_receive_toolcallid_in_permission_requests.yaml similarity index 100% rename from test/snapshots/permissions/should_receive_toolCallId_in_permission_requests.yaml rename to test/snapshots/permissions/should_receive_toolcallid_in_permission_requests.yaml diff --git a/test/snapshots/session/should_create_a_session_with_appended_systemMessage_config.yaml b/test/snapshots/session/should_create_a_session_with_appended_systemmessage_config.yaml similarity index 100% rename from test/snapshots/session/should_create_a_session_with_appended_systemMessage_config.yaml rename to test/snapshots/session/should_create_a_session_with_appended_systemmessage_config.yaml diff --git a/test/snapshots/session/should_create_a_session_with_availableTools.yaml b/test/snapshots/session/should_create_a_session_with_availabletools.yaml similarity index 100% rename from test/snapshots/session/should_create_a_session_with_availableTools.yaml rename to test/snapshots/session/should_create_a_session_with_availabletools.yaml diff --git a/test/snapshots/session/should_create_a_session_with_excludedTools.yaml b/test/snapshots/session/should_create_a_session_with_excludedtools.yaml similarity index 100% rename from test/snapshots/session/should_create_a_session_with_excludedTools.yaml rename to test/snapshots/session/should_create_a_session_with_excludedtools.yaml diff --git a/test/snapshots/session/should_create_a_session_with_replaced_systemMessage_config.yaml b/test/snapshots/session/should_create_a_session_with_replaced_systemmessage_config.yaml similarity index 100% rename from test/snapshots/session/should_create_a_session_with_replaced_systemMessage_config.yaml rename to test/snapshots/session/should_create_a_session_with_replaced_systemmessage_config.yaml