acceptance: extend cmd/lakebox tests to cover write-path commands#5476
Merged
akshaysingla-db merged 1 commit intoJun 8, 2026
Conversation
Adds 14 leaf scenarios covering the rest of the lakebox subcommand surface beyond the read-path / error-path tests landed in databricks#5474: list/json status/running status/json ssh-key/list/with-entries ssh-key/delete/success delete/success (with --auto-approve) delete/not-found (verifies friendly 404 message) delete/no-tty-no-auto-approve (verifies fast-fail with flag pointer) default/set default/not-found start/already-running stop/success config/update-name create/with-name Each test stubs the relevant API endpoint(s) and asserts the rendered output. Two of the ssh-key tests pin the test key hash via a high-priority [[Repls]] entry so the framework's default 3+-digit-run → [NUMID] regex doesn't shred it mid-hash. Two test-infrastructure additions at the lakebox parent level: - `script.prepare` sets `HOME=$TEST_TMP_DIR` so each test's ~/.databricks/lakebox.json is isolated. Without this, parallel tests race each other writing to the shared HOME-rooted state file and one read sees the other's half-written content. Auth is unaffected because the framework passes DATABRICKS_HOST/TOKEN explicitly. - `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = []` overrides the root matrix to skip the per-engine variants. Lakebox is engine-independent and running both variants in parallel was the original symptom of the HOME race. All 20 lakebox acceptance tests (6 prior + 14 new) pass cleanly. ./task lint clean. Co-authored-by: Isaac
Contributor
Waiting for approvalCould not determine reviewers from git history. Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
576f9ca
into
databricks:demo-lakebox
13 of 20 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second batch of lakebox acceptance tests, following #5474. Covers 14 leaf scenarios on the write/connection-path commands and JSON output shapes that weren't in the first batch.
list/json-o jsonshape (no FQDN field, gatewayHost present, idleTimeout serialized as Duration string)status/runningstatus/jsonssh-key/list/with-entries(unset)ssh-key/delete/successdelete/success--auto-approveto bypass the promptdelete/not-foundno lakebox named X(the consistency fix from #5460)delete/no-tty-no-auto-approve--auto-approveflagdefault/setdefault/not-foundstart/already-runningstop/successconfig/update-namecreate/with-nameTwo test-infrastructure additions
acceptance/cmd/lakebox/script.preparesetsHOME=$TEST_TMP_DIRso each test's~/.databricks/lakebox.jsonis isolated. Without this, parallel lakebox tests race each other writing to the shared HOME-rooted state file and one read sees the other's half-written content. Auth is unaffected — the framework passesDATABRICKS_HOST/DATABRICKS_TOKENexplicitly via env, so the CLI doesn't fall back to~/.databrickscfg.EnvMatrix.DATABRICKS_BUNDLE_ENGINE = []in the parenttest.tomloverrides the root matrix to skip the per-engine variants. Lakebox is engine-independent and running both variants in parallel was the original symptom of the HOME race.Two of the ssh-key tests also pin the test key hash via a high-priority
[[Repls]]entry so the framework's default 3+-digit-run →[NUMID]regex doesn't shred it mid-hash.Test plan
go test ./acceptance -run TestAccept/cmd/lakebox— all 20 tests pass (6 from acceptance: add cmd/lakebox tests #5474 + 14 new)./task lintclean-updateand then without is idempotent (no drift)Still out of scope
register— generates and reads real SSH keys viassh-keygen; needs a heavier fixture / process stubssh—execvs into ssh; not testable through this frameworkThis pull request and its description were written by Isaac.