Skip to content

acc: cover environments setup-local on cloud, drop the integration equivalents - #8117

Merged
denik merged 5 commits into
mainfrom
denik/intdep-environments
Nov 27, 2026
Merged

denik merged 5 commits into
mainfrom
denik/intdep-environments

Conversation

@denik

@denik denik commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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, .agents/rules/testing.md). Earlier batches: #6113, #6140, #6223, #6316, #7251.

Dashboard: integration/cmd/environments.TestSetupLocalServerlessProvision, 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.
Assertion map
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

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.

denik and others added 3 commits November 27, 2026 12:45
…uivalents

cloud: TestAccept/localenv/published-serverless-dry-run TestAccept/localenv/published-serverless-provision
Co-authored-by: Isaac <no-reply@databricks.com>
…OS venv path

cloud: TestAccept/localenv/published-serverless-dry-run TestAccept/localenv/published-serverless-provision
Co-authored-by: Isaac <no-reply@databricks.com>
cloud: TestAccept/localenv/published-serverless-dry-run TestAccept/localenv/published-serverless-provision
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the test-only-fix PRs that update failing of flaky tests without changing CLI code. label Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: d5a6ed9a1 | Workflow run

Selected 1 changed tests (limit=20, 0 not selected)

1 tests: regression=0 unreleased=0 coverage=1 failing=0
test branch main (901da84) latest (v1.28.0)
TestAccept/localenv/published-serverless ✅ ✅ ✅

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: d5a6ed9

Run: 46017014112

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 174 17 4:22
💚​ aws-windows-latest-4core-16gb 1 174 17 3:27
💚​ azure linux-2core-8gb 1 173 17 4:26
💚​ azure-windows-latest-4core-16gb 1 173 17 4:14
💚​ gcp linux-2core-8gb 1 174 17 4:07
💚​ gcp-windows-latest-4core-16gb 1 174 17 3:26
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:06 azure linux-2core-8gb TestAccept
4:02 aws linux-2core-8gb TestAccept
3:50 gcp linux-2core-8gb TestAccept
3:19 azure-windows-latest-4core-16gb TestAccept
2:40 gcp-windows-latest-4core-16gb TestAccept
2:40 aws-windows-latest-4core-16gb TestAccept

@denik
denik marked this pull request as ready for review November 27, 2026 13:07
@denik
denik requested review from a team as code owners November 27, 2026 13:07

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review at d0459c4. Each finding was verified against the code.

Not ready yet: 1 blocking issue(s), tagged [blocking].

This PR moves the three environments setup-local --serverless-version integration tests into two Cloud = true acceptance tests and deletes integration/cmd/environments. The dry-run test runs both locally and on cloud. The provision test exits with SKIP_TEST whenever CLOUD_ENV is empty, so it never runs locally, and the testing rules don't allow that for a Cloud = true test. One small nit: neither golden shows the command that produced it.

@andrewnester andrewnester left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holding my approval until the open thread on acceptance/localenv/published-serverless-provision/script is settled.

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review at d0459c4. Each finding was verified against the code.

No blocking issues found. 2 non-blocking comment(s) below.

This PR deletes integration/cmd/environments and moves its three setup-local --serverless-version tests to two Cloud = true acceptance tests: a real provision and a dry-run/unpublished-version check. The dry-run port is close to the original. The provision test, though, exits with SKIP_TEST on every local run, which goes against the testing rule that Cloud = true adds a cloud run and never removes the local one. The v9999 case also uses errcode where the rules ask for musterr.

Merge published-serverless-provision into published-serverless (renamed from
published-serverless-dry-run): the dry runs run locally and on cloud; the
real provision runs on cloud only and is diffed against provision.expected.txt.
Trace the CLI calls.

cloud: TestAccept/localenv/published-serverless

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik requested a review from andrewnester November 27, 2026 14:11
cloud: TestAccept/localenv/published-serverless

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik enabled auto-merge November 27, 2026 14:49
@denik
denik added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 3e7c38f Nov 27, 2026
27 checks passed
@denik
denik deleted the denik/intdep-environments branch November 27, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

factory-generated test-only-fix PRs that update failing of flaky tests without changing CLI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants