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
1 change: 1 addition & 0 deletions .agents/rules/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Ignore = ["databricks.yml"] # parsed as EnvMatrix.Ignore, not top-level Ignore
- `errcode CMD...`: run CMD; if it exits non-zero, append `Exit code: N` to the output but let the script continue (scripts run under `bash -e`, which would otherwise abort). Use when a command is *allowed* to fail and later steps must still run.
- `musterr CMD...`: run CMD and fail the whole test if it *succeeds*; on the expected failure the script continues. Use to assert a command must error.
- `withdir DIR CMD...`: run CMD with the working directory set to DIR, restoring it afterwards.
- `destroy-bundle [ARGS...]`: run `bundle destroy --auto-approve` (traced, so output is identical to calling it directly) and then remove the `~/.bundle/<name>` directory the bundle was deployed under. Prefer it over a bare `trace $CLI bundle destroy --auto-approve` when the test is done with the bundle: on a real workspace a leftover directory is never reused, and they accumulate against the workspace's child-node limit. It removes the directory recursively, so do not use it to destroy one target while another target of the same bundle must stay deployed.
- `git-repo-init`: initialize a deterministic git repo (fixed user/email, no hooks) and commit `databricks.yml`.
- `uuid`, `sethome DIR`, `venv_activate`, `as-test-sp CMD...`, `readplanarg FILE`, `envsubst`: see `acceptance/script.prepare` for the full list and exact semantics.

Expand Down
2 changes: 1 addition & 1 deletion acceptance/apps/deploy/bundle-no-args-with-flags/script
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

trace $CLI apps deploy --skip-validation --auto-approve --force-lock --fail-on-active-runs

trace $CLI bundle destroy --auto-approve
destroy-bundle
2 changes: 1 addition & 1 deletion acceptance/apps/deploy/bundle-no-args/script
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

trace $CLI apps deploy --skip-validation

trace $CLI bundle destroy --auto-approve
destroy-bundle
2 changes: 1 addition & 1 deletion acceptance/bundle/ai_runtime_task/local_code_source/script
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ trace $CLI bundle deploy
trace print_requests.py --sort --del-field raw_body '//.air_snapshots/'

title "destroy removes the deployed bundle (including the synced snapshots)\n"
trace $CLI bundle destroy --auto-approve
destroy-bundle
rm out.requests.txt
2 changes: 1 addition & 1 deletion acceptance/bundle/apps/app_yaml/script
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ trace jq 'select(.path | test("app.yml"))' out.requests.txt | sed 's/\\r//g' >
#trace print_requests.py //apps # currently fails due to TF inserting description=""
rm out.requests.txt

trace $CLI bundle destroy --auto-approve
destroy-bundle
trace print_requests.py //apps
2 changes: 1 addition & 1 deletion acceptance/bundle/apps/compute_size/script
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ envsubst < databricks.yml.tmpl > databricks.yml

# Set up cleanup trap to ensure resources are destroyed even on failure
cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/apps/git_source/script
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ envsubst < databricks.yml.tmpl > databricks.yml

# Set up cleanup trap to ensure resources are destroyed even on failure
cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/apps/job_permissions/script
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ patch -s --no-backup-if-mismatch databricks.yml < fix.patch
trace $CLI bundle deploy -qq
trace has_manage_run

trace $CLI bundle destroy --auto-approve
destroy-bundle
2 changes: 1 addition & 1 deletion acceptance/bundle/bundle_tag/id/script
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ trace $CLI bundle plan
trace $CLI bundle deploy
trace print_requests.py //jobs
trace $CLI bundle summary
trace $CLI bundle destroy --auto-approve
destroy-bundle
trace print_requests.py //jobs
2 changes: 1 addition & 1 deletion acceptance/bundle/bundle_tag/url/script
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ trace $CLI bundle plan
trace $CLI bundle deploy
trace print_requests.py //jobs
trace $CLI bundle summary
trace $CLI bundle destroy --auto-approve
destroy-bundle
trace print_requests.py //jobs
2 changes: 1 addition & 1 deletion acceptance/bundle/config-remote-sync/cli_defaults/script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/config-remote-sync/config_edits/script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/config-remote-sync/dashboard_etag/script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/config-remote-sync/flushed_cache/script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/config-remote-sync/job_fields/script
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_repl "$DEFAULT_SPARK_VERSION" DEFAULT_SPARK_VERSION
add_repl "$NODE_TYPE_ID" NODE_TYPE_ID

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
# destroy records requests too; drop the recorded file so it is not compared.
rm -f out.requests.txt
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/config-remote-sync/multiple_files/script
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ envsubst < resources/job1.yml.tmpl > resources/job1.yml
envsubst < resources/job2.yml.tmpl > resources/job2.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cleanup() {
# Restore original config before destroy to avoid Terraform errors
# from server-side-only fields (e.g. creator_name) written by config-remote-sync.
envsubst < databricks.yml.tmpl > databricks.yml
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/config-remote-sync/output_json/script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
# destroy records requests too; drop the recorded file so it is not compared.
rm -f out.requests.txt
}
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/config-remote-sync/select_basic/script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ envsubst < overrides/10-first.yml.tmpl > overrides/10-first.yml
envsubst < overrides/20-second.yml.tmpl > overrides/20-second.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve -t dev
destroy-bundle -t dev
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cleanup() {
# Restore valid paths for destroy to work (includes pipeline_root_v2 from sync)
mkdir -p pipeline_root pipeline_root_v2 src
echo '# Databricks notebook source' > src/notebook.py
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/deploy/empty-bundle/script
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
envsubst < databricks.yml.tmpl > databricks.yml
cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/deploy/files/no-snapshot-sync/script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/deploy/immutable-no-artifacts/script
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ trace $CLI jobs get $JOB_ID | jq '.settings.tasks' | jq '.[] | select(.spark_pyt
trace $CLI jobs get $JOB_ID | jq '.settings.tasks' | jq '.[] | select(.notebook_task != null) | .notebook_task.notebook_path'
trace $CLI jobs get $JOB_ID | jq '.settings.tasks' | jq '.[] | select(.notebook_task != null) | .notebook_task.base_parameters.path'

trace $CLI bundle destroy --auto-approve
destroy-bundle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
envsubst < databricks.yml.tmpl > databricks.yml

cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/deploy/immutable/script
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
envsubst < databricks.yml.tmpl > databricks.yml
cleanup() {
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cleanup() {
# Second deploy has no fault, so it succeeds and prints both summary lines; this
# both cleans up and shows the contrast with the failed deploy above.
trace $CLI bundle deploy
trace $CLI bundle destroy --auto-approve
destroy-bundle
}
trap cleanup EXIT

Expand Down
Loading
Loading