Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/apps/compute_size/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/apps/git_source/script
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/apps/git_source/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/config-remote-sync/output_json/script
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
1 change: 0 additions & 1 deletion acceptance/bundle/resources/postgres_branches/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct", "terraform"]

Ignore = [
"databricks.yml",
"out.requests.txt",
".databricks",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -11,3 +11,5 @@ done

# Try to deploy, expect failure due to missing uv
errcode trace $CLI bundle deploy

cd ../.. && rm -fr tmp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 10 additions & 0 deletions acceptance/internal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading