Skip to content

Add cloud acceptance test for the DMS read path - #6202

Draft
shreyas-goenka wants to merge 4 commits into
mainfrom
isaac/dms-staging-acceptance
Draft

Add cloud acceptance test for the DMS read path#6202
shreyas-goenka wants to merge 4 commits into
mainfrom
isaac/dms-staging-acceptance

Conversation

@shreyas-goenka

Copy link
Copy Markdown
Contributor

Why

The read-only databricks bundle-deployments (DMS) commands are covered today
only by acceptance/cmd/bundle/dms-read-only, which stubs all eight endpoints
against the local testserver. That proves the CLI renders responses correctly,
but never exercises a real server — so a bad DMS commit cannot be caught here.

What

Adds acceptance/cmd/bundle/dms-cloud-read, which runs the same read verbs
against a real workspace.

list-deployments asserts only the response shape: the deployment set grows
as other tests and engineers deploy, and the ids are server-assigned. The four
not-found cases pin the error contract and prove the whole read path is
reachable — DMS resolves the workspace and runs the permission check before it
looks for the row, so a clean NotFound exercises more than the front door.

The staging gate

DMS is placed on DEV and STAGING shards only (environment_in: ["DEV","STAGING"]),
so on a prod control plane every request 404s at the API proxy. CLOUD_ENV
cannot express that split — the staging and prod aws test envs both set
CLOUD_ENV=aws, and the acceptance framework gates on cloud family, not
individual environment.

So script gates on the workspace host, since staging control planes carry
.staging. in the domain, and skips elsewhere. Skipping rather than failing
means this test can join the shared cloud matrix without red-lining the
existing prod entries.

Once DMS reaches prod, drop that guard and this becomes a plain aws cloud
test.

Testing

Verified against e2-dogfood.staging.cloud.databricks.com (a staging shard
where DMS serves):

  • cloud run: dms-cloud-read passes, dms-read-only skips
  • local run: dms-read-only passes, dms-cloud-read skips
  • passes without -update (golden output is stable and workspace-independent)
  • host gate verified both ways (staging host runs; prod-style host skips)

The first golden capture returned ~1,300 lines of real deployments from the
staging workspace, confirming the CLI reached live DMS rather than a stub.

This PR alone changes no CI behaviour: no cloud test env currently points at a
staging workspace, so the test skips everywhere until the companion
eng-dev-ecosystem change adds aws-stg to the matrix.

This pull request and its description were written by Isaac.

Adds acceptance/cmd/bundle/dms-cloud-read, which runs the read-only
bundle-deployments verbs against a real workspace instead of a stubbed
testserver.

DMS is placed on DEV and STAGING shards only, so this case is gated to the
staging cloud env: on a prod control plane the routes 404 at the API proxy,
which is why the existing aws-prod-ucws env cannot cover this service. The
sibling dms-read-only test keeps the local stubbed coverage.

list-deployments asserts only the response shape, since the deployment set and
its server-assigned ids vary per workspace. The four not-found cases pin the
error contract and prove the whole read path is reachable — DMS resolves the
workspace and runs the permission check before looking up the row, so a clean
NotFound exercises more than the front door.

Verified against e2-dogfood (staging shard): passes on cloud, skips locally.

Co-authored-by: Isaac
CLOUD_ENV cannot express "staging only": the staging and prod aws test envs
both set CLOUD_ENV=aws, and the acceptance framework gates on cloud family
rather than individual environment. Without a finer signal, adding aws-stg to
the shared cloud matrix would also run this test on aws-prod-is and
aws-prod-ucws-is, where the DMS routes 404 at the API proxy.

Gate on the workspace host instead: staging control planes carry ".staging." in
the domain. Skipping rather than failing keeps the prod matrix entries green.

Remove the guard once DMS reaches prod; the test then becomes a plain aws cloud
test with no host check.

Co-authored-by: Isaac
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: fc468b8

Run: 31196866289

Env ❌​FAIL 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
❌​ aws linux 3 1 3 4 292 1115 5:19
❌​ aws windows 3 1 3 4 294 1113 6:25
❌​ azure linux 2 1 3 4 291 1115 6:13
❌​ azure windows 2 1 3 4 293 1113 6:34
❌​ gcp linux 2 1 5 292 1115 5:30
❌​ gcp windows 2 1 5 294 1113 6:39
11 interesting tests: 4 SKIP, 3 FAIL, 3 RECOVERED, 1 KNOWN
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
❌​ TestAccept/bundle/resources/model_serving_endpoints/drift/recreated_same_name ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
❌​ TestAccept/cmd/bundle/dms-cloud-read ❌​F ❌​F ❌​F ❌​F ❌​F ❌​F
❌​ TestAccept/cmd/bundle/dms-cloud-read/DATABRICKS_BUNDLE_ENGINE=direct ❌​F ❌​F
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R

Adds a RequiresClassic config flag. When a test sets it and the environment
exports DATABRICKS_TEST_NO_CLASSIC=true, the test is skipped rather than run.

The motivation is a new serverless-only staging test workspace. Of the 217
cloud-enabled acceptance tests, 76 deploy an all-purpose cluster, a job cluster,
or an instance pool; the other 141 need no classic compute. Without a flag those
76 fail at deploy time against a serverless-only workspace, so a genuine
regression is indistinguishable from missing infrastructure.

This is deliberately an environment-declared switch rather than one inferred from
TEST_DEFAULT_CLUSTER_ID being empty: inferring would silently skip these tests
anywhere that fixture happens to be unset, including local runs.

Annotations prefer parent directories where every cloud test underneath needs
classic compute (config-remote-sync, integration_whl, resources/{clusters,
pipelines,jobs}, invariant, deployment/bind/job), with a RequiresClassic = false
override on config-remote-sync/dashboard_etag, which syncs a warehouse-backed
dashboard rather than a job cluster.

Verified against a serverless-only staging workspace: the annotated tests skip
with "Disabled via RequiresClassic", dashboard_etag still runs and passes, and
cmd/fs plus resources/secret_scopes pass on the direct engine.

out.test.toml regeneration is still pending: it requires jq >= 1.7 and this
machine has 1.6, so `go test ./acceptance -run "^TestAccept$" -only-out-test-toml`
must run elsewhere before merge.

Co-authored-by: Isaac
Adds the missing "why" comment to the 19 RequiresClassic annotations that had
none, naming the specific reason per test (a job cluster, a spark_jar_task, a
pipeline, an all-purpose cluster) rather than repeating one generic line.

Two comments were wrong on the first pass: apps/job_permissions and
resources/permissions/jobs/delete_one were justified as "deploys jobs", which is
not classic on its own. Their bundles use spark_python_task and notebook_task
respectively, both of which run on a cluster, so the comments now cite that.

Also picks up the out.test.toml snapshots the harness regenerated for
RequiresClassic, now that materialized_config.go emits it alongside the sibling
Requires* flags. Without that the inherited value is invisible on PRs.

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants