diff --git a/acceptance/cmd/lakebox/config/idle-timeout-bounds/out.test.toml b/acceptance/cmd/lakebox/config/idle-timeout-bounds/out.test.toml index f784a18325..d6187dcb04 100644 --- a/acceptance/cmd/lakebox/config/idle-timeout-bounds/out.test.toml +++ b/acceptance/cmd/lakebox/config/idle-timeout-bounds/out.test.toml @@ -1,3 +1,3 @@ Local = true Cloud = false -EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/config/no-flags/out.test.toml b/acceptance/cmd/lakebox/config/no-flags/out.test.toml index f784a18325..d6187dcb04 100644 --- a/acceptance/cmd/lakebox/config/no-flags/out.test.toml +++ b/acceptance/cmd/lakebox/config/no-flags/out.test.toml @@ -1,3 +1,3 @@ Local = true Cloud = false -EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/config/update-name/out.test.toml b/acceptance/cmd/lakebox/config/update-name/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/config/update-name/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/config/update-name/output.txt b/acceptance/cmd/lakebox/config/update-name/output.txt new file mode 100644 index 0000000000..194bf2ffd1 --- /dev/null +++ b/acceptance/cmd/lakebox/config/update-name/output.txt @@ -0,0 +1,5 @@ + + id happy-panda-1234 + name renamed-project + autostop 15m + diff --git a/acceptance/cmd/lakebox/config/update-name/script b/acceptance/cmd/lakebox/config/update-name/script new file mode 100644 index 0000000000..26d8c398a2 --- /dev/null +++ b/acceptance/cmd/lakebox/config/update-name/script @@ -0,0 +1 @@ +$CLI lakebox config happy-panda-1234 --name renamed-project diff --git a/acceptance/cmd/lakebox/config/update-name/test.toml b/acceptance/cmd/lakebox/config/update-name/test.toml new file mode 100644 index 0000000000..96505610b1 --- /dev/null +++ b/acceptance/cmd/lakebox/config/update-name/test.toml @@ -0,0 +1,10 @@ +[[Server]] +Pattern = "PATCH /api/2.0/lakebox/sandboxes/happy-panda-1234" +Response.Body = ''' +{ + "sandboxId": "happy-panda-1234", + "status": "Running", + "name": "renamed-project", + "idleTimeout": "900s" +} +''' diff --git a/acceptance/cmd/lakebox/create/with-name/out.test.toml b/acceptance/cmd/lakebox/create/with-name/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/create/with-name/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/create/with-name/output.txt b/acceptance/cmd/lakebox/create/with-name/output.txt new file mode 100644 index 0000000000..56262f255c --- /dev/null +++ b/acceptance/cmd/lakebox/create/with-name/output.txt @@ -0,0 +1,4 @@ + ✓ Lakebox happy-panda-1234 is running + default happy-panda-1234 + +happy-panda-1234 diff --git a/acceptance/cmd/lakebox/create/with-name/script b/acceptance/cmd/lakebox/create/with-name/script new file mode 100644 index 0000000000..191c1a3bb9 --- /dev/null +++ b/acceptance/cmd/lakebox/create/with-name/script @@ -0,0 +1 @@ +$CLI lakebox create --name my-project diff --git a/acceptance/cmd/lakebox/create/with-name/test.toml b/acceptance/cmd/lakebox/create/with-name/test.toml new file mode 100644 index 0000000000..4acb38df56 --- /dev/null +++ b/acceptance/cmd/lakebox/create/with-name/test.toml @@ -0,0 +1,10 @@ +[[Server]] +Pattern = "POST /api/2.0/lakebox/sandboxes" +Response.Body = ''' +{ + "sandboxId": "happy-panda-1234", + "status": "Running", + "name": "my-project", + "gatewayHost": "uw2.dbrx.dev" +} +''' diff --git a/acceptance/cmd/lakebox/default/not-found/out.test.toml b/acceptance/cmd/lakebox/default/not-found/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/default/not-found/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/default/not-found/output.txt b/acceptance/cmd/lakebox/default/not-found/output.txt new file mode 100644 index 0000000000..d4054aa91a --- /dev/null +++ b/acceptance/cmd/lakebox/default/not-found/output.txt @@ -0,0 +1,3 @@ +Error: no lakebox named "no-such-box" — `databricks lakebox list` shows available IDs + +Exit code: 1 diff --git a/acceptance/cmd/lakebox/default/not-found/script b/acceptance/cmd/lakebox/default/not-found/script new file mode 100644 index 0000000000..56b54d9a81 --- /dev/null +++ b/acceptance/cmd/lakebox/default/not-found/script @@ -0,0 +1 @@ +errcode $CLI lakebox default no-such-box diff --git a/acceptance/cmd/lakebox/default/not-found/test.toml b/acceptance/cmd/lakebox/default/not-found/test.toml new file mode 100644 index 0000000000..3d2b831b41 --- /dev/null +++ b/acceptance/cmd/lakebox/default/not-found/test.toml @@ -0,0 +1,4 @@ +[[Server]] +Pattern = "GET /api/2.0/lakebox/sandboxes/no-such-box" +Response.StatusCode = 404 +Response.Body = '{"error_code": "NOT_FOUND", "message": "Sandbox not found"}' diff --git a/acceptance/cmd/lakebox/default/set/out.test.toml b/acceptance/cmd/lakebox/default/set/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/default/set/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/default/set/output.txt b/acceptance/cmd/lakebox/default/set/output.txt new file mode 100644 index 0000000000..030c7884ea --- /dev/null +++ b/acceptance/cmd/lakebox/default/set/output.txt @@ -0,0 +1 @@ +Default lakebox set to: happy-panda-1234 diff --git a/acceptance/cmd/lakebox/default/set/script b/acceptance/cmd/lakebox/default/set/script new file mode 100644 index 0000000000..2a4da7a47a --- /dev/null +++ b/acceptance/cmd/lakebox/default/set/script @@ -0,0 +1 @@ +$CLI lakebox default happy-panda-1234 diff --git a/acceptance/cmd/lakebox/default/set/test.toml b/acceptance/cmd/lakebox/default/set/test.toml new file mode 100644 index 0000000000..61a48b3a37 --- /dev/null +++ b/acceptance/cmd/lakebox/default/set/test.toml @@ -0,0 +1,9 @@ +[[Server]] +Pattern = "GET /api/2.0/lakebox/sandboxes/happy-panda-1234" +Response.Body = ''' +{ + "sandboxId": "happy-panda-1234", + "status": "Running", + "name": "my-project" +} +''' diff --git a/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/out.test.toml b/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/output.txt b/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/output.txt new file mode 100644 index 0000000000..a6ebce31a7 --- /dev/null +++ b/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/output.txt @@ -0,0 +1,3 @@ +Error: `databricks lakebox delete` permanently destroys the sandbox; pass --auto-approve to confirm in non-interactive contexts + +Exit code: 1 diff --git a/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/script b/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/script new file mode 100644 index 0000000000..889c1a933b --- /dev/null +++ b/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/script @@ -0,0 +1,3 @@ +# No --auto-approve and no TTY → must fail fast pointing at the flag, +# not hang on a read from a closed stdin. +errcode $CLI lakebox delete happy-panda-1234 diff --git a/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/test.toml b/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/test.toml new file mode 100644 index 0000000000..d99bfa3599 --- /dev/null +++ b/acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/test.toml @@ -0,0 +1,9 @@ +[[Server]] +Pattern = "GET /api/2.0/lakebox/sandboxes/happy-panda-1234" +Response.Body = ''' +{ + "sandboxId": "happy-panda-1234", + "status": "Stopped", + "name": "my-project" +} +''' diff --git a/acceptance/cmd/lakebox/delete/not-found/out.test.toml b/acceptance/cmd/lakebox/delete/not-found/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/delete/not-found/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/delete/not-found/output.txt b/acceptance/cmd/lakebox/delete/not-found/output.txt new file mode 100644 index 0000000000..d4054aa91a --- /dev/null +++ b/acceptance/cmd/lakebox/delete/not-found/output.txt @@ -0,0 +1,3 @@ +Error: no lakebox named "no-such-box" — `databricks lakebox list` shows available IDs + +Exit code: 1 diff --git a/acceptance/cmd/lakebox/delete/not-found/script b/acceptance/cmd/lakebox/delete/not-found/script new file mode 100644 index 0000000000..a5be268dff --- /dev/null +++ b/acceptance/cmd/lakebox/delete/not-found/script @@ -0,0 +1 @@ +errcode $CLI lakebox delete no-such-box --auto-approve diff --git a/acceptance/cmd/lakebox/delete/not-found/test.toml b/acceptance/cmd/lakebox/delete/not-found/test.toml new file mode 100644 index 0000000000..3d2b831b41 --- /dev/null +++ b/acceptance/cmd/lakebox/delete/not-found/test.toml @@ -0,0 +1,4 @@ +[[Server]] +Pattern = "GET /api/2.0/lakebox/sandboxes/no-such-box" +Response.StatusCode = 404 +Response.Body = '{"error_code": "NOT_FOUND", "message": "Sandbox not found"}' diff --git a/acceptance/cmd/lakebox/delete/success/out.test.toml b/acceptance/cmd/lakebox/delete/success/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/delete/success/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/delete/success/output.txt b/acceptance/cmd/lakebox/delete/success/output.txt new file mode 100644 index 0000000000..b9684e2ee2 --- /dev/null +++ b/acceptance/cmd/lakebox/delete/success/output.txt @@ -0,0 +1 @@ + ✓ Removed happy-panda-1234 diff --git a/acceptance/cmd/lakebox/delete/success/script b/acceptance/cmd/lakebox/delete/success/script new file mode 100644 index 0000000000..b5cbae3596 --- /dev/null +++ b/acceptance/cmd/lakebox/delete/success/script @@ -0,0 +1 @@ +$CLI lakebox delete happy-panda-1234 --auto-approve diff --git a/acceptance/cmd/lakebox/delete/success/test.toml b/acceptance/cmd/lakebox/delete/success/test.toml new file mode 100644 index 0000000000..8c818e25c2 --- /dev/null +++ b/acceptance/cmd/lakebox/delete/success/test.toml @@ -0,0 +1,13 @@ +[[Server]] +Pattern = "GET /api/2.0/lakebox/sandboxes/happy-panda-1234" +Response.Body = ''' +{ + "sandboxId": "happy-panda-1234", + "status": "Stopped", + "name": "my-project" +} +''' + +[[Server]] +Pattern = "DELETE /api/2.0/lakebox/sandboxes/happy-panda-1234" +Response.Body = '{}' diff --git a/acceptance/cmd/lakebox/list/empty/out.test.toml b/acceptance/cmd/lakebox/list/empty/out.test.toml index f784a18325..d6187dcb04 100644 --- a/acceptance/cmd/lakebox/list/empty/out.test.toml +++ b/acceptance/cmd/lakebox/list/empty/out.test.toml @@ -1,3 +1,3 @@ Local = true Cloud = false -EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/list/json/out.test.toml b/acceptance/cmd/lakebox/list/json/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/list/json/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/list/json/output.txt b/acceptance/cmd/lakebox/list/json/output.txt new file mode 100644 index 0000000000..ccd52b804e --- /dev/null +++ b/acceptance/cmd/lakebox/list/json/output.txt @@ -0,0 +1,9 @@ +[ + { + "sandboxId": "happy-panda-1234", + "status": "Running", + "gatewayHost": "uw2.dbrx.dev", + "name": "my-project", + "idleTimeout": "900s" + } +] diff --git a/acceptance/cmd/lakebox/list/json/script b/acceptance/cmd/lakebox/list/json/script new file mode 100644 index 0000000000..0e7fbd07d5 --- /dev/null +++ b/acceptance/cmd/lakebox/list/json/script @@ -0,0 +1 @@ +$CLI lakebox list --json diff --git a/acceptance/cmd/lakebox/list/json/test.toml b/acceptance/cmd/lakebox/list/json/test.toml new file mode 100644 index 0000000000..cf34c1a826 --- /dev/null +++ b/acceptance/cmd/lakebox/list/json/test.toml @@ -0,0 +1,15 @@ +[[Server]] +Pattern = "GET /api/2.0/lakebox/sandboxes" +Response.Body = ''' +{ + "sandboxes": [ + { + "sandboxId": "happy-panda-1234", + "status": "Running", + "name": "my-project", + "gatewayHost": "uw2.dbrx.dev", + "idleTimeout": "900s" + } + ] +} +''' diff --git a/acceptance/cmd/lakebox/list/with-entries/out.test.toml b/acceptance/cmd/lakebox/list/with-entries/out.test.toml index f784a18325..d6187dcb04 100644 --- a/acceptance/cmd/lakebox/list/with-entries/out.test.toml +++ b/acceptance/cmd/lakebox/list/with-entries/out.test.toml @@ -1,3 +1,3 @@ Local = true Cloud = false -EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/script.prepare b/acceptance/cmd/lakebox/script.prepare new file mode 100644 index 0000000000..628b902885 --- /dev/null +++ b/acceptance/cmd/lakebox/script.prepare @@ -0,0 +1,8 @@ +# Isolate the lakebox state file (~/.databricks/lakebox.json) per test +# by pointing HOME at this test's unique TEST_TMP_DIR. Without this, +# parallel lakebox tests race each other writing to the shared HOME's +# state file and one read sees the other's half-written content. +# Auth is unaffected: the test framework passes DATABRICKS_HOST / +# DATABRICKS_TOKEN explicitly via env, so the CLI doesn't fall back to +# ~/.databrickscfg. +export HOME="$TEST_TMP_DIR" diff --git a/acceptance/cmd/lakebox/ssh-key/delete/success/out.test.toml b/acceptance/cmd/lakebox/ssh-key/delete/success/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/ssh-key/delete/success/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/ssh-key/delete/success/output.txt b/acceptance/cmd/lakebox/ssh-key/delete/success/output.txt new file mode 100644 index 0000000000..c306c9ab58 --- /dev/null +++ b/acceptance/cmd/lakebox/ssh-key/delete/success/output.txt @@ -0,0 +1 @@ + ✓ SSH key [KEY_HASH] deleted diff --git a/acceptance/cmd/lakebox/ssh-key/delete/success/script b/acceptance/cmd/lakebox/ssh-key/delete/success/script new file mode 100644 index 0000000000..a9f26f7226 --- /dev/null +++ b/acceptance/cmd/lakebox/ssh-key/delete/success/script @@ -0,0 +1 @@ +$CLI lakebox ssh-key delete 98b3b2bce82049769b4ba03990460d09 diff --git a/acceptance/cmd/lakebox/ssh-key/delete/success/test.toml b/acceptance/cmd/lakebox/ssh-key/delete/success/test.toml new file mode 100644 index 0000000000..056a1e4b69 --- /dev/null +++ b/acceptance/cmd/lakebox/ssh-key/delete/success/test.toml @@ -0,0 +1,9 @@ +[[Server]] +Pattern = "DELETE /api/2.0/lakebox/ssh-keys/98b3b2bce82049769b4ba03990460d09" +Response.Body = '{}' + +# See ssh-key/list/with-entries/test.toml for why we pin the hash. +[[Repls]] +Old = '98b3b2bce82049769b4ba03990460d09' +New = '[KEY_HASH]' +Order = 5 diff --git a/acceptance/cmd/lakebox/ssh-key/list/empty/out.test.toml b/acceptance/cmd/lakebox/ssh-key/list/empty/out.test.toml index f784a18325..d6187dcb04 100644 --- a/acceptance/cmd/lakebox/ssh-key/list/empty/out.test.toml +++ b/acceptance/cmd/lakebox/ssh-key/list/empty/out.test.toml @@ -1,3 +1,3 @@ Local = true Cloud = false -EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/ssh-key/list/with-entries/out.test.toml b/acceptance/cmd/lakebox/ssh-key/list/with-entries/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/ssh-key/list/with-entries/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/ssh-key/list/with-entries/output.txt b/acceptance/cmd/lakebox/ssh-key/list/with-entries/output.txt new file mode 100644 index 0000000000..3fae0e5cd1 --- /dev/null +++ b/acceptance/cmd/lakebox/ssh-key/list/with-entries/output.txt @@ -0,0 +1,8 @@ + + NAME KEY HASH CREATED LAST USED + ────────────────────────────────────────────────────────────────────────────────────── + laptop [KEY_HASH_1] 2026-05-29 17:18 2026-05-29 17:19 + (unset) [KEY_HASH_2] 2026-05-12 21:31 2026-05-29 17:13 + + (no local lakebox key on this machine — run `databricks lakebox register` to create and register one) + diff --git a/acceptance/cmd/lakebox/ssh-key/list/with-entries/script b/acceptance/cmd/lakebox/ssh-key/list/with-entries/script new file mode 100644 index 0000000000..ddeb83258e --- /dev/null +++ b/acceptance/cmd/lakebox/ssh-key/list/with-entries/script @@ -0,0 +1 @@ +$CLI lakebox ssh-key list diff --git a/acceptance/cmd/lakebox/ssh-key/list/with-entries/test.toml b/acceptance/cmd/lakebox/ssh-key/list/with-entries/test.toml new file mode 100644 index 0000000000..d6791df2e5 --- /dev/null +++ b/acceptance/cmd/lakebox/ssh-key/list/with-entries/test.toml @@ -0,0 +1,31 @@ +[[Server]] +Pattern = "GET /api/2.0/lakebox/ssh-keys" +Response.Body = ''' +{ + "sshKeys": [ + { + "keyHash": "98b3b2bce82049769b4ba03990460d09", + "name": "laptop", + "createTime": "2026-05-29T17:18:00Z", + "lastUseTime": "2026-05-29T17:19:00Z" + }, + { + "keyHash": "9e0fc7c899aeee6a462e3153aeae8f30", + "createTime": "2026-05-12T21:31:00Z", + "lastUseTime": "2026-05-29T17:13:00Z" + } + ] +} +''' + +# Pin our test hashes to stable placeholders so the framework's +# generic 3+-digit-run → [NUMID] regex doesn't mangle them. +[[Repls]] +Old = '98b3b2bce82049769b4ba03990460d09' +New = '[KEY_HASH_1]' +Order = 5 + +[[Repls]] +Old = '9e0fc7c899aeee6a462e3153aeae8f30' +New = '[KEY_HASH_2]' +Order = 5 diff --git a/acceptance/cmd/lakebox/start/already-running/out.test.toml b/acceptance/cmd/lakebox/start/already-running/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/start/already-running/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/start/already-running/output.txt b/acceptance/cmd/lakebox/start/already-running/output.txt new file mode 100644 index 0000000000..14f2076c32 --- /dev/null +++ b/acceptance/cmd/lakebox/start/already-running/output.txt @@ -0,0 +1 @@ + ✓ Already running happy-panda-1234 diff --git a/acceptance/cmd/lakebox/start/already-running/script b/acceptance/cmd/lakebox/start/already-running/script new file mode 100644 index 0000000000..765025f61d --- /dev/null +++ b/acceptance/cmd/lakebox/start/already-running/script @@ -0,0 +1 @@ +$CLI lakebox start happy-panda-1234 diff --git a/acceptance/cmd/lakebox/start/already-running/test.toml b/acceptance/cmd/lakebox/start/already-running/test.toml new file mode 100644 index 0000000000..6de67aaf48 --- /dev/null +++ b/acceptance/cmd/lakebox/start/already-running/test.toml @@ -0,0 +1,10 @@ +[[Server]] +Pattern = "POST /api/2.0/lakebox/sandboxes/happy-panda-1234/start" +Response.Body = ''' +{ + "sandboxId": "happy-panda-1234", + "status": "Running", + "name": "my-project", + "gatewayHost": "uw2.dbrx.dev" +} +''' diff --git a/acceptance/cmd/lakebox/status/json/out.test.toml b/acceptance/cmd/lakebox/status/json/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/status/json/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/status/json/output.txt b/acceptance/cmd/lakebox/status/json/output.txt new file mode 100644 index 0000000000..efabf82446 --- /dev/null +++ b/acceptance/cmd/lakebox/status/json/output.txt @@ -0,0 +1,7 @@ +{ + "sandboxId": "happy-panda-1234", + "status": "Running", + "gatewayHost": "uw2.dbrx.dev", + "name": "my-project", + "idleTimeout": "1800s" +} diff --git a/acceptance/cmd/lakebox/status/json/script b/acceptance/cmd/lakebox/status/json/script new file mode 100644 index 0000000000..63be140f85 --- /dev/null +++ b/acceptance/cmd/lakebox/status/json/script @@ -0,0 +1 @@ +$CLI lakebox status happy-panda-1234 --json diff --git a/acceptance/cmd/lakebox/status/json/test.toml b/acceptance/cmd/lakebox/status/json/test.toml new file mode 100644 index 0000000000..aaa8c7754b --- /dev/null +++ b/acceptance/cmd/lakebox/status/json/test.toml @@ -0,0 +1,11 @@ +[[Server]] +Pattern = "GET /api/2.0/lakebox/sandboxes/happy-panda-1234" +Response.Body = ''' +{ + "sandboxId": "happy-panda-1234", + "status": "Running", + "name": "my-project", + "gatewayHost": "uw2.dbrx.dev", + "idleTimeout": "1800s" +} +''' diff --git a/acceptance/cmd/lakebox/status/not-found/out.test.toml b/acceptance/cmd/lakebox/status/not-found/out.test.toml index f784a18325..d6187dcb04 100644 --- a/acceptance/cmd/lakebox/status/not-found/out.test.toml +++ b/acceptance/cmd/lakebox/status/not-found/out.test.toml @@ -1,3 +1,3 @@ Local = true Cloud = false -EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/status/running/out.test.toml b/acceptance/cmd/lakebox/status/running/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/status/running/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/status/running/output.txt b/acceptance/cmd/lakebox/status/running/output.txt new file mode 100644 index 0000000000..1121ab9bc8 --- /dev/null +++ b/acceptance/cmd/lakebox/status/running/output.txt @@ -0,0 +1,7 @@ + + id happy-panda-1234 + name my-project + status running + gateway uw2.dbrx.dev + autostop 30m + diff --git a/acceptance/cmd/lakebox/status/running/script b/acceptance/cmd/lakebox/status/running/script new file mode 100644 index 0000000000..b4fa44b97d --- /dev/null +++ b/acceptance/cmd/lakebox/status/running/script @@ -0,0 +1 @@ +$CLI lakebox status happy-panda-1234 diff --git a/acceptance/cmd/lakebox/status/running/test.toml b/acceptance/cmd/lakebox/status/running/test.toml new file mode 100644 index 0000000000..aaa8c7754b --- /dev/null +++ b/acceptance/cmd/lakebox/status/running/test.toml @@ -0,0 +1,11 @@ +[[Server]] +Pattern = "GET /api/2.0/lakebox/sandboxes/happy-panda-1234" +Response.Body = ''' +{ + "sandboxId": "happy-panda-1234", + "status": "Running", + "name": "my-project", + "gatewayHost": "uw2.dbrx.dev", + "idleTimeout": "1800s" +} +''' diff --git a/acceptance/cmd/lakebox/stop/success/out.test.toml b/acceptance/cmd/lakebox/stop/success/out.test.toml new file mode 100644 index 0000000000..d6187dcb04 --- /dev/null +++ b/acceptance/cmd/lakebox/stop/success/out.test.toml @@ -0,0 +1,3 @@ +Local = true +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = [] diff --git a/acceptance/cmd/lakebox/stop/success/output.txt b/acceptance/cmd/lakebox/stop/success/output.txt new file mode 100644 index 0000000000..3a5b0fc2f0 --- /dev/null +++ b/acceptance/cmd/lakebox/stop/success/output.txt @@ -0,0 +1 @@ + ✓ Stopped happy-panda-1234 diff --git a/acceptance/cmd/lakebox/stop/success/script b/acceptance/cmd/lakebox/stop/success/script new file mode 100644 index 0000000000..1f0f8f1d7d --- /dev/null +++ b/acceptance/cmd/lakebox/stop/success/script @@ -0,0 +1 @@ +$CLI lakebox stop happy-panda-1234 diff --git a/acceptance/cmd/lakebox/stop/success/test.toml b/acceptance/cmd/lakebox/stop/success/test.toml new file mode 100644 index 0000000000..224108fca7 --- /dev/null +++ b/acceptance/cmd/lakebox/stop/success/test.toml @@ -0,0 +1,9 @@ +[[Server]] +Pattern = "POST /api/2.0/lakebox/sandboxes/happy-panda-1234/stop" +Response.Body = ''' +{ + "sandboxId": "happy-panda-1234", + "status": "Stopped", + "name": "my-project" +} +''' diff --git a/acceptance/cmd/lakebox/test.toml b/acceptance/cmd/lakebox/test.toml index a87ef9180b..55283671eb 100644 --- a/acceptance/cmd/lakebox/test.toml +++ b/acceptance/cmd/lakebox/test.toml @@ -1,4 +1,11 @@ -# Acceptance tests for `databricks lakebox` subcommands. Common across -# all leaves: ignore the local state file the CLI writes (lakebox.json) -# so it doesn't bleed into the test directory's diff. +# Acceptance tests for `databricks lakebox` subcommands. +# +# Ignore the local state file the CLI writes (lakebox.json) so it +# doesn't bleed into the test directory's diff. Ignore = [".databricks"] + +# Lakebox commands are independent of the bundle engine. Override the +# root EnvMatrix so the two engines don't both run in parallel for +# every lakebox test — when they did, they raced each other writing +# to the same ~/.databricks/lakebox.json file. +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = []