diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index 0dff5c82f9..695027f0a2 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -682,7 +682,7 @@ func runTest(t *testing.T, if _, ok := Ignored[relPath]; ok { continue } - if config.CompiledIgnoreObject.MatchesPath(relPath) { + if config.CompiledIgnoreObject.MatchesPath(relPath) && !strings.HasPrefix(relPath, "out") { continue } if strings.HasPrefix(filepath.Base(relPath), "LOG") { diff --git a/acceptance/bundle/apps/compute_size/test.toml b/acceptance/bundle/apps/compute_size/test.toml index df8141452c..60f5da6887 100644 --- a/acceptance/bundle/apps/compute_size/test.toml +++ b/acceptance/bundle/apps/compute_size/test.toml @@ -2,7 +2,7 @@ Local = true Cloud = true RecordRequests = false -Ignore = [".databricks", "databricks.yml", "databricks.yml.bak", "out.app-run"] +Ignore = [".databricks", "databricks.yml", "databricks.yml.bak", "tmp.app-run"] # Apps can take longer to deploy TimeoutCloud = "5m" diff --git a/acceptance/bundle/apps/git_source/script b/acceptance/bundle/apps/git_source/script index 5e87210ee4..b1241ec40a 100644 --- a/acceptance/bundle/apps/git_source/script +++ b/acceptance/bundle/apps/git_source/script @@ -28,8 +28,8 @@ title "Verify no drift after deployment" trace $CLI bundle plan title "Run the app to verify it works" -$CLI bundle run my_app &> out.app-run || true -trace cat out.app-run | head -20 +$CLI bundle run my_app &> tmp.app-run || true +trace cat tmp.app-run | head -20 title "Update git_source branch and redeploy" # Change branch from main to a different value (still main, but via sed to test config change) diff --git a/acceptance/bundle/apps/git_source/test.toml b/acceptance/bundle/apps/git_source/test.toml index ee68c7a08d..819e361dcd 100644 --- a/acceptance/bundle/apps/git_source/test.toml +++ b/acceptance/bundle/apps/git_source/test.toml @@ -5,7 +5,7 @@ Cloud = false RecordRequests = false RequiresWarehouse = true -Ignore = [".databricks", "databricks.yml", "databricks.yml.bak", "out.app-run"] +Ignore = [".databricks", "databricks.yml", "databricks.yml.bak", "tmp.app-run"] # Apps can take longer to deploy TimeoutCloud = "5m" diff --git a/acceptance/bundle/config-remote-sync/output_json/script b/acceptance/bundle/config-remote-sync/output_json/script index 761a4e3de1..c452faa1dc 100755 --- a/acceptance/bundle/config-remote-sync/output_json/script +++ b/acceptance/bundle/config-remote-sync/output_json/script @@ -17,5 +17,5 @@ r["tags"] = {"env": "test"} EOF title "JSON output format" -$CLI bundle config-remote-sync -o json > out.json -cat out.json +$CLI bundle config-remote-sync -o json > tmp.json +cat tmp.json diff --git a/acceptance/bundle/config-remote-sync/output_json/test.toml b/acceptance/bundle/config-remote-sync/output_json/test.toml index 37fbb30d66..056ad8b30b 100644 --- a/acceptance/bundle/config-remote-sync/output_json/test.toml +++ b/acceptance/bundle/config-remote-sync/output_json/test.toml @@ -1,7 +1,7 @@ Cloud = true RecordRequests = false -Ignore = [".databricks", "dummy.whl", "out.json", "databricks.yml"] +Ignore = [".databricks", "dummy.whl", "tmp.json", "databricks.yml"] [Env] DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC = "true" diff --git a/acceptance/bundle/config-remote-sync/output_no_changes/script b/acceptance/bundle/config-remote-sync/output_no_changes/script index ea238cc52a..1bef0ab9c0 100755 --- a/acceptance/bundle/config-remote-sync/output_no_changes/script +++ b/acceptance/bundle/config-remote-sync/output_no_changes/script @@ -20,5 +20,5 @@ $CLI bundle config-remote-sync | contains.py "No changes detected" title "JSON output" echo -$CLI bundle config-remote-sync -o json > out.json -cat out.json +$CLI bundle config-remote-sync -o json > tmp.json +cat tmp.json diff --git a/acceptance/bundle/config-remote-sync/output_no_changes/test.toml b/acceptance/bundle/config-remote-sync/output_no_changes/test.toml index 37fbb30d66..056ad8b30b 100644 --- a/acceptance/bundle/config-remote-sync/output_no_changes/test.toml +++ b/acceptance/bundle/config-remote-sync/output_no_changes/test.toml @@ -1,7 +1,7 @@ Cloud = true RecordRequests = false -Ignore = [".databricks", "dummy.whl", "out.json", "databricks.yml"] +Ignore = [".databricks", "dummy.whl", "tmp.json", "databricks.yml"] [Env] DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC = "true" diff --git a/acceptance/bundle/resources/postgres_branches/basic/script b/acceptance/bundle/resources/postgres_branches/basic/script index c753ecdf14..0086234c2e 100644 --- a/acceptance/bundle/resources/postgres_branches/basic/script +++ b/acceptance/bundle/resources/postgres_branches/basic/script @@ -2,6 +2,7 @@ envsubst < databricks.yml.tmpl > databricks.yml cleanup() { trace $CLI bundle destroy --auto-approve + rm -f out.requests.txt } trap cleanup EXIT diff --git a/acceptance/bundle/resources/postgres_branches/recreate/script b/acceptance/bundle/resources/postgres_branches/recreate/script index 31bc023b12..f81650b2e7 100755 --- a/acceptance/bundle/resources/postgres_branches/recreate/script +++ b/acceptance/bundle/resources/postgres_branches/recreate/script @@ -5,6 +5,8 @@ cleanup() { # Also try to delete the old branch directly in case it wasn't cleaned up $CLI postgres delete-branch "projects/test-pg-proj-${UNIQUE_NAME}/branches/old-branch-${UNIQUE_NAME}" 2>/dev/null || true + + rm -f out.requests.txt } trap cleanup EXIT @@ -51,5 +53,3 @@ print_requests destroy # Clean up any orphaned old branch (terraform doesn't delete it on recreation) $CLI postgres delete-branch $branch_id_1 2>/dev/null || true - -rm -f out.requests.txt diff --git a/acceptance/bundle/resources/postgres_branches/test.toml b/acceptance/bundle/resources/postgres_branches/test.toml index 5e22b1116a..9a4d447f99 100644 --- a/acceptance/bundle/resources/postgres_branches/test.toml +++ b/acceptance/bundle/resources/postgres_branches/test.toml @@ -11,7 +11,6 @@ EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct", "terraform"] Ignore = [ "databricks.yml", - "out.requests.txt", ".databricks", ] diff --git a/acceptance/bundle/resources/postgres_branches/update_protected/script b/acceptance/bundle/resources/postgres_branches/update_protected/script index 85eba7fed9..cbdec19a6c 100755 --- a/acceptance/bundle/resources/postgres_branches/update_protected/script +++ b/acceptance/bundle/resources/postgres_branches/update_protected/script @@ -2,6 +2,7 @@ envsubst < databricks.yml.tmpl > databricks.yml cleanup() { trace $CLI bundle destroy --auto-approve + rm -f out.requests.txt } trap cleanup EXIT diff --git a/acceptance/bundle/resources/postgres_branches/without_branch_id/script b/acceptance/bundle/resources/postgres_branches/without_branch_id/script index 4e03eb0ba2..519a143b44 100755 --- a/acceptance/bundle/resources/postgres_branches/without_branch_id/script +++ b/acceptance/bundle/resources/postgres_branches/without_branch_id/script @@ -2,6 +2,7 @@ envsubst < databricks.yml.tmpl > databricks.yml cleanup() { $CLI bundle destroy --auto-approve > /dev/null 2>&1 || true + rm -f out.requests.txt } trap cleanup EXIT diff --git a/acceptance/bundle/templates/default-python/fail-missing-uv/output.txt b/acceptance/bundle/templates/default-python/fail-missing-uv/output.txt index 8eec220aec..9b8f39f93e 100644 --- a/acceptance/bundle/templates/default-python/fail-missing-uv/output.txt +++ b/acceptance/bundle/templates/default-python/fail-missing-uv/output.txt @@ -1,5 +1,5 @@ ->>> [CLI] bundle init default-python --config-file ./input.json --output-dir output +>>> [CLI] bundle init default-python --config-file ./input.json --output-dir tmp Welcome to the default Python template for Declarative Automation Bundles! Answer the following questions to customize your project. diff --git a/acceptance/bundle/templates/default-python/fail-missing-uv/script b/acceptance/bundle/templates/default-python/fail-missing-uv/script index 2d2d451f8a..7e0cca4d67 100644 --- a/acceptance/bundle/templates/default-python/fail-missing-uv/script +++ b/acceptance/bundle/templates/default-python/fail-missing-uv/script @@ -1,6 +1,6 @@ -trace $CLI bundle init default-python --config-file ./input.json --output-dir output +trace $CLI bundle init default-python --config-file ./input.json --output-dir tmp -cd output/fail_missing_uv +cd tmp/fail_missing_uv trace $CLI bundle validate # Dynamically find ALL directories containing 'uv' and remove them from PATH @@ -11,3 +11,5 @@ done # Try to deploy, expect failure due to missing uv errcode trace $CLI bundle deploy + +cd ../.. && rm -fr tmp diff --git a/acceptance/bundle/templates/default-python/fail-missing-uv/test.toml b/acceptance/bundle/templates/default-python/fail-missing-uv/test.toml index 8e90e70cd5..2f7c45f0ab 100644 --- a/acceptance/bundle/templates/default-python/fail-missing-uv/test.toml +++ b/acceptance/bundle/templates/default-python/fail-missing-uv/test.toml @@ -3,10 +3,6 @@ Badness = "The error message is not ideal: it reports a generic build failure or Local = true Cloud = false -Ignore = [ - 'output/fail_missing_uv', -] - # Replace the uv not found error for portability [[Repls]] Old = '(/usr)?(/bin)?/bash(: line 1)?: uv: command not found' diff --git a/acceptance/internal/config.go b/acceptance/internal/config.go index 65fcadfbf3..376047c9ca 100644 --- a/acceptance/internal/config.go +++ b/acceptance/internal/config.go @@ -228,6 +228,16 @@ func validateConfig(t *testing.T, config TestConfig, configPath string) { t.Fatalf("Invalid config %s: RunsOnDbr and RecordRequests cannot both be true. "+ "Serverless does not allow access to localhost ports, which the test proxy server requires.", configPath) } + + // Reject Ignore patterns that target out* files, since those are generated + // output files and must never be ignored. + for _, pattern := range config.Ignore { + name := strings.TrimLeft(pattern, "!/") + if strings.HasPrefix(name, "out") { + t.Fatalf("Invalid config %s: Ignore pattern %q targets output files (out*). "+ + "Output files must not be ignored.", configPath, pattern) + } + } } func DoLoadConfig(t *testing.T, path string) TestConfig {