Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions dotnet/test/Harness/E2ETestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion go/e2e/testharness/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nodejs/test/e2e/harness/sdkTestContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}

Expand Down
2 changes: 1 addition & 1 deletion python/e2e/testharness/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading