Skip to content

acc: cover dashboard workspace import on cloud, drop the integration equivalent - #8073

Merged
denik merged 3 commits into
mainfrom
intdep-assumptions
Nov 30, 2026
Merged

denik merged 3 commits into
mainfrom
intdep-assumptions

Conversation

@denik

@denik denik commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • integration/assumptions.TestDashboardAssumptions_WorkspaceImport: PORTED into acceptance/cmd/workspace/export-dir-dashboard (Cloud = true, every cloud). After the existing export, the test imports new .lvdash.json content over the dashboard's path (as Lakeview reports it, /Users/...) with workspace import --format AUTO --overwrite and then checks:
    • get-status under both spellings of the path (/Users/... and /Workspace/Users/...) still reports a DASHBOARD whose resource_id is the dashboard's id;
    • the import applied the new content;
    • compared with the create response, only etag and update_time changed (serialized_dashboard changed on purpose, and warehouse_id may be dropped by some backend versions, as the integration test allowed);
    • a second lakeview create with the same name in the same folder fails with HTTP 409 ALREADY_EXISTS (or RESOURCE_ALREADY_EXISTS, which the test treats the same), checked with contains.py on the --debug log.
  • The integration/assumptions package is deleted.
  • Testserver: an AUTO /workspace/import with overwrite onto an existing dashboard's path now updates that dashboard in place (etag, update_time, serialized_dashboard), as the real API does. Before this change it replaced the dashboard with a plain FILE. The testserver also resolves a dashboard's path without the /Workspace prefix (the form Lakeview returns) for get-status and this import; other object types are unchanged. The etag bump moves into a helper shared with the Lakeview update handler.

Why

The integration/ tree is deprecated (integration/README.md): cloud coverage goes into acceptance tests with Cloud = true, which also run locally against the testserver. Earlier batches: #6113, #6140, #6223, #6316, #7251.

Dashboard: integration/assumptions.TestDashboardAssumptions_WorkspaceImport (the test being removed; passing on main as of 2026-11-26).

The CLI still relies on two of these facts:

  • bundle generate dashboard --existing-path resolves a dashboard from its workspace object's resource_id, and --watch calls get-status on the path Lakeview reports.
  • The direct engine's create recovery looks a dashboard up by its .lvdash.json path and treats a 409 already-exists as "maybe ours".

Coverage proof

Method: the integration test's -coverpkg profile was recorded on AWS. Neither the test nor the code it reaches branches on the cloud. That profile was compared block by block with per-test acceptance coverage: a full local run plus local and AWS runs of the extended test.

integration test verdict product blocks covered acceptance tests
TestDashboardAssumptions_WorkspaceImport PORTED 183 (24 harness noise) 158 of 159 cmd/workspace/export-dir-dashboard

Real gap, harness-only: libs/dyn/merge/override.go:69.4,70.1. The test body calls merge.Override itself to diff the create response against the get response. No CLI command is under test there. The acceptance script now does that diff with jq, and the cloud-recorded output pins it.

Assertion map
integration test line fact acceptance check where
35-43 Lakeview create succeeds lakeview create ... -o json > created.json, id used later local + cloud
46-54 AUTO import with overwrite onto the dashboard's Lakeview path succeeds workspace import /Users/... --format AUTO --overwrite with no error local + cloud
57-61 get-status on that path succeeds; resource_id equals the dashboard id "resource_id": "[DASHBOARD_ID]" and "object_type": "DASHBOARD", for both path spellings local + cloud
67-79 second create with same name in same folder → 409 musterr, HTTP status 409, "error_code": "ALREADY_EXISTS" local + cloud
84-87 Lakeview get after import succeeds retry --until-not <create etag> lakeview get local + cloud
101-104 no field inserted vs the create response "inserted": [] local + cloud
118-119 updated = etag, update_time (+ serialized_dashboard) "updated": ["etag", "update_time"] local + cloud
120 deleted ⊆ {warehouse_id} "deleted": [] local + cloud
cleanup test folder removed EXIT trap: lakeview trash + workspace delete --recursive local + cloud

Runtime: the integration test took about 3s on AWS. The extended acceptance test adds an import, a get-status, one or two gets and a failing create, a few seconds on cloud. Locally it stays under a second.

Judgment calls

  • The testserver's new path alias covers dashboards only. Aliasing /Users/... to /Workspace/Users/... for every object type would change many other tests, so it is left out of this PR.
  • The port imports different content than it created with, so the test also shows the import applied the body. The integration test re-imported the same payload.
  • The conflict check pins only the final HTTP status and the error code, not the message: per integration: Loosen dashboard-conflict assertion to ErrResourceConflict #5043, wording and code vary by backend version.

Gaps and risks

  • Azure and GCP runs come from this PR's cloud: line. Locally the test ran on AWS and against the testserver.
  • The display name in the integration test had a space (New Dashboard); the port's does not.
  • Not modeled in the testserver: AUTO import of a .lvdash.json onto a new path (stays a FILE), and RAW or import-file over a dashboard. No test uses these, and the real behavior is unverified.
  • Risk: low (test-only plus a narrow testserver handler for the new call).

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.

@github-actions github-actions Bot added the test-only-fix PRs that update failing of flaky tests without changing CLI code. label Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: cffe548dd | Workflow run

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

1 tests: regression=0 unreleased=0 coverage=1 failing=0
test branch main (ecb4cc6) latest (v1.28.0)
TestAccept/cmd/workspace/export-dir-dashboard ✅ ✅ ✅

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: cffe548

Run: 46404062830

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 172 14 2:35
💚​ aws-windows-latest-4core-16gb 1 171 15 2:41
💚​ azure linux-2core-8gb 1 171 14 2:38
💚​ azure-windows-latest-4core-16gb 1 170 15 2:41
💚​ gcp linux-2core-8gb 1 172 14 2:37
💚​ gcp-windows-latest-4core-16gb 1 171 15 3:09
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 3 slowest tests (at least 2 minutes):
duration env testname
3:07 gcp-windows-latest-4core-16gb TestAccept
2:40 aws-windows-latest-4core-16gb TestAccept
2:39 azure-windows-latest-4core-16gb TestAccept

…equivalent

Extend acceptance/cmd/workspace/export-dir-dashboard to import new content
over the dashboard's .lvdash.json path (as Lakeview reports it) through the
workspace import API and check that both spellings of the path keep naming
the dashboard, that the content was applied, that only etag and update_time
changed relative to the create response, and that a second create in the
folder is a 409 conflict. Teach the testserver the in-place update for that
import and the unprefixed dashboard path.

Delete integration/assumptions, whose only test checked the same facts.

cloud: TestAccept/cmd/workspace/export-dir-dashboard

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the intdep-assumptions branch from f73e6db to 29a11ae Compare November 26, 2026 19:36
@denik
denik marked this pull request as ready for review November 26, 2026 20:01
@denik
denik requested review from a team as code owners November 26, 2026 20:01
@denik
denik requested review from Sankalp-Mittal, andrewnester and rauchy and removed request for rauchy November 26, 2026 20:01

@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 29a11ae. Each finding was verified against the code.

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

This PR moves TestDashboardAssumptions_WorkspaceImport into the export-dir-dashboard acceptance test with Cloud = true and deletes the integration test. It also teaches the testserver that an AUTO import with overwrite onto a dashboard's path updates that dashboard in place. I traced the testserver changes and found no problems: the path alias, the import-over-dashboard handler and the bumpEtag extraction all behave as described. The one thing to change is the inline grep | tail | sed conflict check, which goes against the acceptance helper rule.

Route the --debug output of the expected-to-fail create to LOG.conflict
and assert the final HTTP status and the error code with contains.py
instead of a grep/sed pipeline, as .agents/rules/testing.md asks.

cloud: TestAccept/cmd/workspace/export-dir-dashboard

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik requested a review from andrewnester November 26, 2026 23:33
Lakeview reads after a write can stay stale on cloud for longer than
retry.py's ~2s default; use the same window as the dashboards tests.

cloud: TestAccept/cmd/workspace/export-dir-dashboard

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik enabled auto-merge November 30, 2026 10:53
@denik
denik added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 56ff8df Nov 30, 2026
27 checks passed
@denik
denik deleted the intdep-assumptions branch November 30, 2026 11:22
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