mirror of https://github.com/databricks/cli.git
Remove test-specific logic from generic test runner (#2215)
Revert changes to acceptance_test.go added in #2177 and add test-specific fix.
This commit is contained in:
parent
20c1902a45
commit
ba3a400327
|
@ -9,7 +9,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"slices"
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
|
@ -452,16 +451,6 @@ func CopyDir(src, dst string, inputs, outputs map[string]bool) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ListDir(t *testing.T, src string) ([]string, error) {
|
func ListDir(t *testing.T, src string) ([]string, error) {
|
||||||
// exclude folders in .gitignore from comparison
|
|
||||||
ignored := []string{
|
|
||||||
"\\.ruff_cache",
|
|
||||||
"\\.venv",
|
|
||||||
".*\\.egg-info",
|
|
||||||
"__pycache__",
|
|
||||||
// depends on uv version
|
|
||||||
"uv.lock",
|
|
||||||
}
|
|
||||||
|
|
||||||
var files []string
|
var files []string
|
||||||
err := filepath.Walk(src, func(path string, info os.FileInfo, err error) error {
|
err := filepath.Walk(src, func(path string, info os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -469,19 +458,7 @@ func ListDir(t *testing.T, src string) ([]string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if info.IsDir() {
|
if info.IsDir() {
|
||||||
for _, ignoredFolder := range ignored {
|
|
||||||
if matched, _ := regexp.MatchString(ignoredFolder, info.Name()); matched {
|
|
||||||
return filepath.SkipDir
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
} else {
|
|
||||||
for _, ignoredFolder := range ignored {
|
|
||||||
if matched, _ := regexp.MatchString(ignoredFolder, info.Name()); matched {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
relPath, err := filepath.Rel(src, path)
|
relPath, err := filepath.Rel(src, path)
|
||||||
|
|
|
@ -10,3 +10,5 @@ cat databricks.yml | grep -v databricks_cli_version > databricks.yml.new
|
||||||
mv databricks.yml.new databricks.yml
|
mv databricks.yml.new databricks.yml
|
||||||
|
|
||||||
trace $CLI bundle validate -t dev --output json | jq ".resources"
|
trace $CLI bundle validate -t dev --output json | jq ".resources"
|
||||||
|
|
||||||
|
rm -fr .venv resources/__pycache__ uv.lock my_jobs_as_code.egg-info
|
||||||
|
|
Loading…
Reference in New Issue