Skip to content

Commit

Permalink
Remove test-specific logic from generic test runner (#2215)
Browse files Browse the repository at this point in the history
Revert changes to acceptance_test.go added in #2177 and add
test-specific fix.
  • Loading branch information
denik authored Jan 23, 2025
1 parent 20c1902 commit ba3a400
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
23 changes: 0 additions & 23 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"slices"
"sort"
Expand Down Expand Up @@ -452,36 +451,14 @@ func CopyDir(src, dst string, inputs, outputs map[string]bool) 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
err := filepath.Walk(src, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}

if info.IsDir() {
for _, ignoredFolder := range ignored {
if matched, _ := regexp.MatchString(ignoredFolder, info.Name()); matched {
return filepath.SkipDir
}
}

return nil
} else {
for _, ignoredFolder := range ignored {
if matched, _ := regexp.MatchString(ignoredFolder, info.Name()); matched {
return nil
}
}
}

relPath, err := filepath.Rel(src, path)
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/templates/experimental-jobs-as-code/script
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ cat databricks.yml | grep -v databricks_cli_version > databricks.yml.new
mv databricks.yml.new databricks.yml

trace $CLI bundle validate -t dev --output json | jq ".resources"

rm -fr .venv resources/__pycache__ uv.lock my_jobs_as_code.egg-info

0 comments on commit ba3a400

Please sign in to comment.