Repository navigation
acc: cover dashboard workspace import on cloud, drop the integration equivalent - #8073
Conversation
Regression test report ✅Commit: Selected 1 changed tests (limit=20, 0 not selected) 1 tests: regression=0 unreleased=0 coverage=1 failing=0
|
✅ Integration test reportCommit: cffe548
Top 3 slowest tests (at least 2 minutes):
|
…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>
f73e6db to
29a11ae
Compare
There was a problem hiding this comment.
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>
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>
Changes
integration/assumptions.TestDashboardAssumptions_WorkspaceImport: PORTED intoacceptance/cmd/workspace/export-dir-dashboard(Cloud = true, every cloud). After the existing export, the test imports new.lvdash.jsoncontent over the dashboard's path (as Lakeview reports it,/Users/...) withworkspace import --format AUTO --overwriteand then checks:get-statusunder both spellings of the path (/Users/...and/Workspace/Users/...) still reports aDASHBOARDwhoseresource_idis the dashboard's id;etagandupdate_timechanged (serialized_dashboardchanged on purpose, andwarehouse_idmay be dropped by some backend versions, as the integration test allowed);lakeview createwith the same name in the same folder fails with HTTP 409ALREADY_EXISTS(orRESOURCE_ALREADY_EXISTS, which the test treats the same), checked withcontains.pyon the--debuglog.integration/assumptionspackage is deleted./workspace/importwith 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 plainFILE. The testserver also resolves a dashboard's path without the/Workspaceprefix (the form Lakeview returns) forget-statusand 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 withCloud = 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-pathresolves a dashboard from its workspace object'sresource_id, and--watchcallsget-statuson the path Lakeview reports..lvdash.jsonpath and treats a 409 already-exists as "maybe ours".Coverage proof
Method: the integration test's
-coverpkgprofile 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.Real gap, harness-only:
libs/dyn/merge/override.go:69.4,70.1. The test body callsmerge.Overrideitself to diff the create response against the get response. No CLI command is under test there. The acceptance script now does that diff withjq, and the cloud-recorded output pins it.Assertion map
lakeview create ... -o json > created.json, id used laterpathsucceedsworkspace import /Users/... --format AUTO --overwritewith no errorget-statuson that path succeeds;resource_idequals the dashboard id"resource_id": "[DASHBOARD_ID]"and"object_type": "DASHBOARD", for both path spellingsmusterr,HTTP status 409,"error_code": "ALREADY_EXISTS"retry --until-not <create etag> lakeview get"inserted": []"updated": ["etag", "update_time"]"deleted": []lakeview trash+workspace delete --recursiveRuntime: 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
/Users/...to/Workspace/Users/...for every object type would change many other tests, so it is left out of this PR.Gaps and risks
cloud:line. Locally the test ran on AWS and against the testserver.New Dashboard); the port's does not..lvdash.jsononto a new path (stays aFILE), and RAW orimport-fileover a dashboard. No test uses these, and the real behavior is unverified.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.