Skip to content
Merged
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

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

2 changes: 1 addition & 1 deletion acceptance/cmd/lakebox/config/no-flags/out.test.toml

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

3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/config/update-name/out.test.toml

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

5 changes: 5 additions & 0 deletions acceptance/cmd/lakebox/config/update-name/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

id happy-panda-1234
name renamed-project
autostop 15m

1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/config/update-name/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox config happy-panda-1234 --name renamed-project
10 changes: 10 additions & 0 deletions acceptance/cmd/lakebox/config/update-name/test.toml
Original file line number Diff line number Diff line change
@@ -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"
}
'''
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/create/with-name/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/cmd/lakebox/create/with-name/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
✓ Lakebox happy-panda-1234 is running
default happy-panda-1234

happy-panda-1234
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/create/with-name/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox create --name my-project
10 changes: 10 additions & 0 deletions acceptance/cmd/lakebox/create/with-name/test.toml
Original file line number Diff line number Diff line change
@@ -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"
}
'''
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/default/not-found/out.test.toml

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

3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/default/not-found/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Error: no lakebox named "no-such-box" — `databricks lakebox list` shows available IDs

Exit code: 1
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/default/not-found/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
errcode $CLI lakebox default no-such-box
4 changes: 4 additions & 0 deletions acceptance/cmd/lakebox/default/not-found/test.toml
Original file line number Diff line number Diff line change
@@ -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"}'
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/default/set/out.test.toml

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

1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/default/set/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Default lakebox set to: happy-panda-1234
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/default/set/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox default happy-panda-1234
9 changes: 9 additions & 0 deletions acceptance/cmd/lakebox/default/set/test.toml
Original file line number Diff line number Diff line change
@@ -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"
}
'''

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Error: `databricks lakebox delete` permanently destroys the sandbox; pass --auto-approve to confirm in non-interactive contexts

Exit code: 1
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/delete/no-tty-no-auto-approve/script
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
}
'''
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/delete/not-found/out.test.toml

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

3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/delete/not-found/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Error: no lakebox named "no-such-box" — `databricks lakebox list` shows available IDs

Exit code: 1
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/delete/not-found/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
errcode $CLI lakebox delete no-such-box --auto-approve
4 changes: 4 additions & 0 deletions acceptance/cmd/lakebox/delete/not-found/test.toml
Original file line number Diff line number Diff line change
@@ -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"}'
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/delete/success/out.test.toml

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

1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/delete/success/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
✓ Removed happy-panda-1234
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/delete/success/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox delete happy-panda-1234 --auto-approve
13 changes: 13 additions & 0 deletions acceptance/cmd/lakebox/delete/success/test.toml
Original file line number Diff line number Diff line change
@@ -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 = '{}'
2 changes: 1 addition & 1 deletion acceptance/cmd/lakebox/list/empty/out.test.toml

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

3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/list/json/out.test.toml

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

9 changes: 9 additions & 0 deletions acceptance/cmd/lakebox/list/json/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"sandboxId": "happy-panda-1234",
"status": "Running",
"gatewayHost": "uw2.dbrx.dev",
"name": "my-project",
"idleTimeout": "900s"
}
]
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/list/json/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox list --json
15 changes: 15 additions & 0 deletions acceptance/cmd/lakebox/list/json/test.toml
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
'''
2 changes: 1 addition & 1 deletion acceptance/cmd/lakebox/list/with-entries/out.test.toml

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

8 changes: 8 additions & 0 deletions acceptance/cmd/lakebox/script.prepare
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/ssh-key/delete/success/out.test.toml

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

1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/ssh-key/delete/success/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
✓ SSH key [KEY_HASH] deleted
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/ssh-key/delete/success/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox ssh-key delete 98b3b2bce82049769b4ba03990460d09
9 changes: 9 additions & 0 deletions acceptance/cmd/lakebox/ssh-key/delete/success/test.toml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion acceptance/cmd/lakebox/ssh-key/list/empty/out.test.toml

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

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

8 changes: 8 additions & 0 deletions acceptance/cmd/lakebox/ssh-key/list/with-entries/output.txt
Original file line number Diff line number Diff line change
@@ -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)

1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/ssh-key/list/with-entries/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox ssh-key list
31 changes: 31 additions & 0 deletions acceptance/cmd/lakebox/ssh-key/list/with-entries/test.toml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/start/already-running/out.test.toml

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

1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/start/already-running/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
✓ Already running happy-panda-1234
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/start/already-running/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox start happy-panda-1234
10 changes: 10 additions & 0 deletions acceptance/cmd/lakebox/start/already-running/test.toml
Original file line number Diff line number Diff line change
@@ -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"
}
'''
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/status/json/out.test.toml

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

7 changes: 7 additions & 0 deletions acceptance/cmd/lakebox/status/json/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sandboxId": "happy-panda-1234",
"status": "Running",
"gatewayHost": "uw2.dbrx.dev",
"name": "my-project",
"idleTimeout": "1800s"
}
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/status/json/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox status happy-panda-1234 --json
11 changes: 11 additions & 0 deletions acceptance/cmd/lakebox/status/json/test.toml
Original file line number Diff line number Diff line change
@@ -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"
}
'''
2 changes: 1 addition & 1 deletion acceptance/cmd/lakebox/status/not-found/out.test.toml

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

3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/status/running/out.test.toml

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

7 changes: 7 additions & 0 deletions acceptance/cmd/lakebox/status/running/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

id happy-panda-1234
name my-project
status running
gateway uw2.dbrx.dev
autostop 30m

1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/status/running/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox status happy-panda-1234
11 changes: 11 additions & 0 deletions acceptance/cmd/lakebox/status/running/test.toml
Original file line number Diff line number Diff line change
@@ -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"
}
'''
3 changes: 3 additions & 0 deletions acceptance/cmd/lakebox/stop/success/out.test.toml

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

1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/stop/success/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
✓ Stopped happy-panda-1234
1 change: 1 addition & 0 deletions acceptance/cmd/lakebox/stop/success/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI lakebox stop happy-panda-1234
9 changes: 9 additions & 0 deletions acceptance/cmd/lakebox/stop/success/test.toml
Original file line number Diff line number Diff line change
@@ -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"
}
'''
13 changes: 10 additions & 3 deletions acceptance/cmd/lakebox/test.toml
Original file line number Diff line number Diff line change
@@ -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 = []
Loading