Repository navigation
Commit 3e7c38f
acc: cover environments setup-local on cloud, drop the integration equivalents (#8117)
## Changes
- Delete `integration/cmd/environments` (3 tests for `databricks
environments setup-local --serverless-version`). All three are PORTED to
the new `acceptance/localenv/published-serverless` (`Cloud = true`):
- Locally and on cloud: a v5 `--dry-run` plans and fetches with nothing
written, and an unpublished v9999 `--dry-run` fails in the fetch phase
with `E_ENV_UNSUPPORTED` (asserted with `musterr`), with nothing
written. Locally the test server serves the artifacts. On cloud the
script unsets the constraint-source override, so the CLI fetches the
real published repo (`artifactSource: network`).
- On cloud only: a real `uv sync` of serverless v5 (the deleted
`TestSetupLocalServerlessProvision`). The JSON result (`ok`, `dryRun:
false`, command, mode, compute, artifact source, Python and
databricks-connect versions present, all six phases `ok`), the exact
project files (`.venv`, `pyproject.toml`, `uv.lock`) and the venv
interpreter at the OS layout are diffed against the committed
`provision.expected.txt`. A mismatch prints the diff and fails the test,
so `output.txt` is identical locally and on cloud.
- The provision step unsets the runner's `UV_OFFLINE`/`UV_FIND_LINKS`,
because the vendored wheels don't include databricks-connect. It gives
`uv python install` a private dir, like the deleted test did.
## Why
`integration/` is deprecated
([integration/README.md](https://github.com/databricks/cli/blob/main/integration/README.md),
`.agents/rules/testing.md`). Earlier batches: #6113, #6140, #6223,
#6316, #7251.
Dashboard:
[integration/cmd/environments.TestSetupLocalServerlessProvision](http://go/cli/dashboard/test/integration/cmd/environments.TestSetupLocalServerlessProvision),
[error/1082](http://go/cli/dashboard/error/1082) (`Received unexpected
error: AlreadyPrinted`, 16 failures across aws/azure/gcp in the week to
2026-11-26).
## Coverage proof
Method: each integration test's `-coverpkg` profile was recorded on AWS.
The tests don't branch on the cloud and make no workspace calls with
`--serverless-version`. Each profile was compared block by block with
per-test acceptance coverage from a full local run plus AWS runs of the
two new tests.
| integration test | verdict | product blocks (command-specific) |
covered | acceptance tests |
|---|---|---|---|---|
| TestSetupLocalServerlessProvision | PORTED | 722 | all but 3
harness-only | localenv/published-serverless (cloud provision step) |
| TestSetupLocalDryRunWritesNothing | PORTED | 618 | all but 3
harness-only | localenv/published-serverless |
| TestSetupLocalUnpublishedVersion | PORTED | 453 | all but 3
harness-only | localenv/published-serverless |
Real-gap blocks are the same for all three, and only the in-process test
harness reaches them:
- `cmd/root/tree.go:54.38,54.55` and `tree.go:57.38,57.55`
(`Tree.SetOut`/`SetErr`): only `internal/testcli` calls them.
- `cmd/root/auth.go:222.3,223.1` (nil host-metadata resolver factory):
only `main.go` registers the factory, so this branch runs only in test
binaries.
<details><summary>Assertion map</summary>
| integration test:line | fact | acceptance check | where |
|---|---|---|---|
| Provision:53 | real provision exits 0 | provision step: `diff` against
provision.expected.txt passes | cloud |
| Provision:62-65 | ok, dryRun=false, command, mode=default |
provision.expected.txt: JSON projection | cloud |
| Provision:67-69 | compute source serverless, envKey
serverless/serverless-v5 | provision.expected.txt: `compute` | cloud |
| Provision:71-74 | pythonVersion and dbconnectVersion non-empty strings
| provision.expected.txt: `hasPythonVersion`, `hasDBConnectVersion` |
cloud |
| Provision:78 | every phase ok | provision.expected.txt: six `<phase>:
ok` lines | cloud |
| Provision:83-85 | venv interpreter (OS layout), pyproject.toml,
uv.lock | provision.expected.txt: `files: .venv pyproject.toml uv.lock`,
`<file>: regular file` | cloud |
| DryRun:96-106 | v5 --dry-run exits 0, ok, dryRun=true |
published-serverless: first section | local + cloud |
| DryRun:110-111 | project dir empty | published-serverless: `files in
project: 0` | local + cloud |
| Unpublished:124-130 | v9999 --dry-run exits non-zero |
published-serverless: `musterr` | local + cloud |
| Unpublished:134-137 | ok=false, E_ENV_UNSUPPORTED, failurePhase fetch
| published-serverless: second projection | local + cloud |
| Unpublished:143-144 | project dir empty | published-serverless: second
`files in project: 0` | local + cloud |
</details>
## Tests
- `published-serverless` passes locally and on AWS (`testme-aws`, empty
uv cache). Earlier heads of this PR ran the same dry-run and provision
checks in two directories, and those passed in the PR's cloud CI on aws,
azure and gcp, linux and windows (real fetch, real interpreter download,
real `uv sync`). The `cloud:` line in the last commit reruns the merged
test on every cloud.
- Mutation checks: making `--dry-run` write `pyproject.toml`
(libs/localenv/pipeline.go, Check branch) fails the test locally (`files
in project: 1`). Changing one line of `provision.expected.txt` fails the
cloud run.
- Runtime: the integration tests took about 48s on AWS (provision 47s,
others about 1s each). The new test takes 15-45s on cloud (most of it
the provision, depending on the uv cache and OS) and under 1s locally.
## Gaps and risks
- The real provision is checked only on cloud; locally the non-dry-run
pipeline is covered by the sibling fake-uv tests (`provision-conflict`,
`provision-conflict-sync`, `workspace-member`). A fake-uv local
provision here would need `GOOS.windows = false`, which would drop the
Windows cloud run.
- The JSON is checked through jq projections, not a typed decode, so a
wrong type in an unprojected field (e.g. `durationMs`) would go
unnoticed, as in the sibling localenv tests.
- The local AWS run took the installed-Python fallback (downloads
disabled on the dev box). CI downloads the interpreter, as the deleted
test did. The output doesn't print which path was taken.
- Selection: `integration/` ran on every cloud run. Acceptance cloud PR
runs pick only changed or named tests, while main and nightly runs run
all of them. So a later `libs/localenv` change runs the provision test
on its PR only if it is named.
- Both tests still depend on the published repo (v5 present, v9999
absent) and on a package index, as the deleted tests did.
- Risk: low.
This PR was created by the integration-deprecation loop.
🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.
---------
Co-authored-by: Isaac <no-reply@databricks.com>1 parent 8569867 commit 3e7c38f
6 files changed
Lines changed: 163 additions & 154 deletions
File tree
- acceptance/localenv/published-serverless
- integration/cmd/environments
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
This file was deleted.
0 commit comments