From ba3a400327833caa822c8a0416808b072c86c264 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Thu, 23 Jan 2025 11:59:01 +0100 Subject: [PATCH] Remove test-specific logic from generic test runner (#2215) Revert changes to acceptance_test.go added in #2177 and add test-specific fix. --- acceptance/acceptance_test.go | 23 ------------------- .../experimental-jobs-as-code/script | 2 ++ 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index e611f4e50..56db6ec20 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -9,7 +9,6 @@ import ( "os" "os/exec" "path/filepath" - "regexp" "runtime" "slices" "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) { - // 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 { @@ -469,19 +458,7 @@ func ListDir(t *testing.T, src string) ([]string, error) { } 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) diff --git a/acceptance/bundle/templates/experimental-jobs-as-code/script b/acceptance/bundle/templates/experimental-jobs-as-code/script index 2209aa7ab..af28b9d0a 100644 --- a/acceptance/bundle/templates/experimental-jobs-as-code/script +++ b/acceptance/bundle/templates/experimental-jobs-as-code/script @@ -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