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
6 changes: 6 additions & 0 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
cli293Path := DownloadCLI(t, buildDir, "0.293.0")
t.Setenv("CLI_293", cli293Path)
repls.SetPath(cli293Path, "[CLI_293]")

prevVersion := resolveLatestVersion(t, buildDir)
cliPrevPath := DownloadCLI(t, buildDir, prevVersion)
t.Setenv("CLI_PREV", cliPrevPath)
repls.SetPath(cliPrevPath, "[CLI_PREV]")
repls.Set(prevVersion, "[CLI_PREV_VERSION]")
}

paths := []string{
Expand Down
52 changes: 52 additions & 0 deletions acceptance/bundle/invariant/continue_prev/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions acceptance/bundle/invariant/continue_prev/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

>>> [CLI_PREV] --version
Databricks CLI v[CLI_PREV_VERSION]
INPUT_CONFIG_OK
41 changes: 41 additions & 0 deletions acceptance/bundle/invariant/continue_prev/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Invariant to test: current CLI can deploy on top of state produced by the previous release

cp -r "$TESTDIR/../data/." . &> LOG.cp

INIT_SCRIPT="$TESTDIR/../configs/$INPUT_CONFIG-init.sh"
if [ -f "$INIT_SCRIPT" ]; then
source "$INIT_SCRIPT" &> LOG.init
fi

envsubst < "$TESTDIR/../configs/$INPUT_CONFIG" > databricks.yml

cleanup() {
$CLI bundle destroy --auto-approve &> LOG.destroy
cat LOG.destroy | contains.py '!panic' '!internal error' > /dev/null

CLEANUP_SCRIPT="$TESTDIR/../configs/$INPUT_CONFIG-cleanup.sh"
if [ -f "$CLEANUP_SCRIPT" ]; then
source "$CLEANUP_SCRIPT" &> LOG.cleanup
fi
}

trap cleanup EXIT

# Deploy with previous released CLI to produce previous-version state
trace $CLI_PREV --version
$CLI_PREV bundle deploy &> LOG.deploy.prev
cat LOG.deploy.prev | contains.py '!panic' '!internal error' > /dev/null

echo INPUT_CONFIG_OK

# Deploy with current CLI on top of previous state
$CLI bundle deploy &> LOG.deploy
cat LOG.deploy | contains.py '!panic' '!internal error' > /dev/null

# Verify no drift after current CLI deploy
$CLI bundle plan -o json > LOG.planjson 2>LOG.planjson.err
cat LOG.planjson.err | contains.py '!panic' '!internal error' > /dev/null
verify_no_drift.py LOG.planjson

$CLI bundle plan 2>LOG.plan.err | contains.py '!panic' '!internal error' 'Plan: 0 to add, 0 to change, 0 to delete' > LOG.plan
cat LOG.plan.err | contains.py '!panic' '!internal error' > /dev/null
13 changes: 13 additions & 0 deletions acceptance/bundle/invariant/continue_prev/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Computed volume_path was added after the previous release (#5550), so the
# seed deploy with the previous CLI cannot resolve ${resources.volumes.*.volume_path}.
# Covered by no_drift on direct.
EnvMatrixExclude.no_volume_path_job_ref = ["INPUT_CONFIG=volume_path_job_ref.yml.tmpl"]

# postgres_project.yml.tmpl sets enable_pg_native_login: false, which triggers a
# state serialization bug on the previous CLI (fixed by #5782).
# Broken on CLI_PREV=1.6.0; remove after the next release.
EnvMatrixExclude.no_postgres_project = ["INPUT_CONFIG=postgres_project.yml.tmpl"]

# The 1000-task scale case is covered by no_drift. Running it here adds ~1.5 min
# per variant (two full deploys at 1000 tasks) without incremental coverage.
EnvMatrixExclude.no_pydabs_1000_tasks = ["INPUT_CONFIG=job_pydabs_1000_tasks.yml.tmpl"]
Loading