Skip to content

Commit af10ba3

Browse files
authored
Fix failing serialized_dashboard acceptance tests (#3119)
## Changes <!-- Brief summary of your changes that is easy to understand --> 1. change the `dashboard/detect-change` acceptance test, so that it only checks for a single field in the `serialized_dashboard` output 2. change the `bind/dashboard` acceptance tests so that it normalizes the contents of the `serialized_dashboard` field before printing to output ## Why <!-- Why are these changes needed? Provide the context that the reviewer might be missing. For example, were there any decisions behind the change that are not reflected in the code itself? --> Due to changes in the Lakeview API these tests started failing in our staging environments ## Tests <!-- How have you tested the changes? --> Ran the changed tests from local machine against AWS and GCP targets <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
1 parent 1c839f1 commit af10ba3

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

acceptance/bundle/deploy/dashboard/detect-change/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Deployment complete!
1414

1515
=== Load the dashboard by its ID and confirm its display name: {
1616
"display_name": "test-dashboard-[UNIQUE_NAME]",
17-
"serialized_dashboard": "{\"pages\":[{\"name\":\"fdd21a3c\",\"displayName\":\"New Page\",\"layout\":[{\"widget\":{\"name\":\"82eb9107\",\"textbox_spec\":\"# I'm a title\"},\"position\":{\"x\":0,\"y\":0,\"width\":6,\"height\":2}},{\"widget\":{\"name\":\"ffa6de4f\",\"textbox_spec\":\"Text\"},\"position\":{\"x\":0,\"y\":2,\"width\":6,\"height\":2}}],\"pageType\":\"PAGE_TYPE_CANVAS\"}]}"
17+
"page_display_name": "New Page"
1818
}
1919

2020
=== Make an out of band modification to the dashboard and confirm that it is detected:

acceptance/bundle/deploy/dashboard/detect-change/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ trace $CLI workspace get-status "${DASHBOARD_PATH}" | jq '{object_type,path}'
1414

1515
title "Load the dashboard by its ID and confirm its display name: "
1616
DASHBOARD_ID=$($CLI bundle summary --output json | jq -r '.resources.dashboards.file_reference.id')
17-
$CLI lakeview get $DASHBOARD_ID | jq '{display_name,serialized_dashboard}'
17+
$CLI lakeview get "${DASHBOARD_ID}" | jq '{display_name,page_display_name: (.serialized_dashboard | fromjson | .pages[0].displayName)}'
1818

1919
title "Make an out of band modification to the dashboard and confirm that it is detected:\n"
2020
RESOURCE_ID=$($CLI workspace get-status "${DASHBOARD_PATH}" | jq -r '.resource_id')

acceptance/bundle/deployment/bind/dashboard/output.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ Deployment complete!
1515
"lifecycle_state": "ACTIVE",
1616
"path": "/Users/[USERNAME]/test dashboard [UUID].lvdash.json",
1717
"parent_path": "/Users/[USERNAME]",
18-
"serialized_dashboard": "{\"pages\":[{\"name\":\"02724bf2\",\"displayName\":\"Page One\",\"pageType\":\"PAGE_TYPE_CANVAS\"}]}"
18+
"serialized_dashboard": {
19+
"pages": [
20+
{
21+
"name": "02724bf2",
22+
"displayName": "Page One",
23+
"pageType": "PAGE_TYPE_CANVAS"
24+
}
25+
]
26+
}
1927
}
2028

2129
>>> [CLI] bundle deployment unbind dashboard1
@@ -33,5 +41,13 @@ Destroy complete!
3341
"lifecycle_state": "ACTIVE",
3442
"path": "/Users/[USERNAME]/test dashboard [UUID].lvdash.json",
3543
"parent_path": "/Users/[USERNAME]",
36-
"serialized_dashboard": "{\"pages\":[{\"name\":\"02724bf2\",\"displayName\":\"Page One\",\"pageType\":\"PAGE_TYPE_CANVAS\"}]}"
44+
"serialized_dashboard": {
45+
"pages": [
46+
{
47+
"name": "02724bf2",
48+
"displayName": "Page One",
49+
"pageType": "PAGE_TYPE_CANVAS"
50+
}
51+
]
52+
}
3753
}

acceptance/bundle/deployment/bind/dashboard/script

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ trace $CLI bundle deployment bind dashboard1 "${DASHBOARD_ID}" --auto-approve
1919

2020
trace $CLI bundle deploy
2121

22-
trace $CLI lakeview get "${DASHBOARD_ID}" | jq '{display_name, lifecycle_state, path, parent_path, serialized_dashboard}'
22+
trace $CLI lakeview get "${DASHBOARD_ID}" | jq '{display_name, lifecycle_state, path, parent_path, serialized_dashboard} | .serialized_dashboard |= fromjson'
2323

2424
trace $CLI bundle deployment unbind dashboard1
2525

2626
trace $CLI bundle destroy --auto-approve
2727

2828
# Read the pre-defined dashboard again (expecting it still exists and is not deleted):
29-
trace $CLI lakeview get "${DASHBOARD_ID}" | jq '{display_name, lifecycle_state, path, parent_path, serialized_dashboard}'
29+
trace $CLI lakeview get "${DASHBOARD_ID}" | jq '{display_name, lifecycle_state, path, parent_path, serialized_dashboard} | .serialized_dashboard |= fromjson'

0 commit comments

Comments
 (0)