Skip to content

Commit da9ac07

Browse files
Improve dashboards test server to match to the real server (#3743)
## Why Used in #3725 to provide local test coverage. ## Tests Existing tests pass with slight modifications.
1 parent 25fdcb2 commit da9ac07

File tree

13 files changed

+140
-32
lines changed

13 files changed

+140
-32
lines changed

acceptance/bundle/deploy/dashboard/nested-folders/test.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ New = "[DASHBOARD_ID]"
1616
# Windows:
1717
Old = 'The system cannot find the file specified.'
1818
New = 'no such file or directory'
19+
20+
[[Repls]]
21+
Old = "[0-9]{10,}"
22+
New = "[DASHBOARD_ID]"

acceptance/bundle/deploy/dashboard/simple/test.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ Ignore = [
99
[[Repls]]
1010
Old = "[0-9a-f]{32}"
1111
New = "[DASHBOARD_ID]"
12+
13+
[[Repls]]
14+
Old = "[0-9]{10,}"
15+
New = "[DASHBOARD_ID]"

acceptance/bundle/deploy/dashboard/simple_outside_bundle_root/test.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ New = "[DASHBOARD_ID]"
1515
# Windows:
1616
Old = 'The system cannot find the file specified.'
1717
New = 'no such file or directory'
18+
19+
[[Repls]]
20+
Old = "[0-9]{10,}"
21+
New = "[DASHBOARD_ID]"

acceptance/bundle/deploy/dashboard/simple_syncroot/test.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ Ignore = [
77
"sample-dashboard.lvdash.json",
88
]
99

10+
[[Repls]]
11+
# Windows:
12+
Old = 'The system cannot find the file specified.'
13+
New = 'no such file or directory'
14+
1015
[[Repls]]
1116
Old = "[0-9a-f]{32}"
1217
New = "[DASHBOARD_ID]"
1318

1419
[[Repls]]
15-
# Windows:
16-
Old = 'The system cannot find the file specified.'
17-
New = 'no such file or directory'
20+
Old = "[0-9]{10,}"
21+
New = "[DASHBOARD_ID]"

acceptance/bundle/generate/dashboard-inplace/output.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ Updating deployment state...
1010
Deployment complete!
1111

1212
=== update the dashboard
13-
>>> [CLI] lakeview update [DASHBOARD_ID] --serialized-dashboard {"a":"b"}
13+
>>> [CLI] lakeview update [NUMID] --serialized-dashboard {"a":"b"}
1414
{
15-
"etag":"[UUID]",
15+
"create_time":"[TIMESTAMP]",
16+
"dashboard_id":"[NUMID]",
17+
"display_name":"test dashboard",
18+
"etag":"[NUMID]",
1619
"lifecycle_state":"ACTIVE",
17-
"serialized_dashboard":"{\"a\":\"b\"}"
20+
"parent_path":"/Users/[USERNAME]/.bundle/dashboard update inplace/default/resources",
21+
"path":"/Users/[USERNAME]/.bundle/dashboard update inplace/default/resources/test dashboard.lvdash.json",
22+
"serialized_dashboard":"{\"a\":\"b\"}",
23+
"update_time":"[TIMESTAMP]Z"
1824
}
1925

2026
=== update the dashboard file using bundle generate
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform"] # dashboards not supported yet
2-
3-
[[Repls]]
4-
Old = "[0-9a-f]{32}"
5-
New = "[DASHBOARD_ID]"

acceptance/bundle/generate/dashboard/dashboard.json renamed to acceptance/bundle/generate/dashboard/dashboard.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"display_name": "test dashboard",
3-
"parent_path": "/test",
3+
"parent_path": "/Workspace/test-$UNIQUE_NAME",
44
"serialized_dashboard": "{\"pages\":[{\"displayName\":\"New Page\",\"layout\":[],\"name\":\"12345678\"}]}"
55
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2-
>>> [CLI] bundle generate dashboard --existing-id [DASHBOARD_ID] --dashboard-dir out/dashboard --resource-dir out/resource
2+
>>> [CLI] workspace mkdirs /Workspace/test-[UNIQUE_NAME]
3+
4+
>>> [CLI] bundle generate dashboard --existing-id [NUMID] --dashboard-dir out/dashboard --resource-dir out/resource
35
Writing dashboard to "out/dashboard/test_dashboard.lvdash.json"
46
Writing configuration to "out/resource/test_dashboard.dashboard.yml"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
trace $CLI workspace mkdirs /Workspace/test-$UNIQUE_NAME
2+
13
# create a dashboard to import
4+
envsubst < dashboard.json.tmpl > dashboard.json
25
dashboard_id=$($CLI lakeview create --json @dashboard.json | jq -r '.dashboard_id')
6+
rm dashboard.json
37

48
trace $CLI bundle generate dashboard --existing-id $dashboard_id --dashboard-dir out/dashboard --resource-dir out/resource

acceptance/bundle/generate/dashboard/test.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ New = '/'
55
[[Repls]]
66
Old = "[0-9a-f]{32}"
77
New = "[DASHBOARD_ID]"
8+
9+
[Env]
10+
MSYS_NO_PATHCONV = "1"

0 commit comments

Comments
 (0)