From 272ce6130272c28f6c8e0a9113a3727b952282fe Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Tue, 11 Feb 2025 15:26:46 +0100 Subject: [PATCH] acc: Fix singleTest option to support forward slashes (#2336) The filtering of tests needs to see forward slashes otherwise it is OS-dependent. I've also switched to filepath.ToSlash but it should be a no-op. --- acceptance/acceptance_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index 320948fda..fce508498 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -180,8 +180,7 @@ func testAccept(t *testing.T, InprocessMode bool, singleTest string) int { } for _, dir := range testDirs { - testName := strings.ReplaceAll(dir, "\\", "/") - t.Run(testName, func(t *testing.T) { + t.Run(dir, func(t *testing.T) { if !InprocessMode { t.Parallel() } @@ -203,7 +202,8 @@ func getTests(t *testing.T) []string { name := filepath.Base(path) if name == EntryPointScript { // Presence of 'script' marks a test case in this directory - testDirs = append(testDirs, filepath.Dir(path)) + testName := filepath.ToSlash(filepath.Dir(path)) + testDirs = append(testDirs, testName) } return nil })