mirror of https://github.com/databricks/cli.git
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.
This commit is contained in:
parent
878fa80322
commit
272ce61302
|
@ -180,8 +180,7 @@ func testAccept(t *testing.T, InprocessMode bool, singleTest string) int {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, dir := range testDirs {
|
for _, dir := range testDirs {
|
||||||
testName := strings.ReplaceAll(dir, "\\", "/")
|
t.Run(dir, func(t *testing.T) {
|
||||||
t.Run(testName, func(t *testing.T) {
|
|
||||||
if !InprocessMode {
|
if !InprocessMode {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
}
|
}
|
||||||
|
@ -203,7 +202,8 @@ func getTests(t *testing.T) []string {
|
||||||
name := filepath.Base(path)
|
name := filepath.Base(path)
|
||||||
if name == EntryPointScript {
|
if name == EntryPointScript {
|
||||||
// Presence of 'script' marks a test case in this directory
|
// 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
|
return nil
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue