Skip to content

Commit b729ac2

Browse files
Convert dashboard tests to acceptance tests (#3186)
## Why Cleaning up a bit. Will allow us to get rid of the `bundle.GetOrNil` method.
1 parent cb71496 commit b729ac2

File tree

16 files changed

+84
-144
lines changed

16 files changed

+84
-144
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"display_name": "test dashboard",
33
"parent_path": "/test",
4-
"serialized_dashboard": "{}"
4+
"serialized_dashboard": "{\"pages\":[{\"displayName\":\"New Page\",\"layout\":[],\"name\":\"12345678\"}]}"
55
}
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
{}
1+
{
2+
"pages": [
3+
{
4+
"displayName": "New Page",
5+
"layout": [],
6+
"name": "[NUMID]",
7+
"pageType": "PAGE_TYPE_CANVAS"
8+
}
9+
]
10+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Local = true
2+
Cloud = false
3+
4+
[EnvMatrix]
5+
DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Error: dashboard with ID f00dcafe not found
2+
3+
4+
Exit code: 1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Test that bundle generate dashboard fails when the existing ID is not found
2+
exec $CLI bundle generate dashboard --existing-id f00dcafe
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bundle:
2+
name: test-bundle
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Local = true
2+
Cloud = false
3+
4+
[EnvMatrix]
5+
DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"pages": [
3+
{
4+
"displayName": "New Page",
5+
"layout": [],
6+
"name": "[NUMID]"
7+
}
8+
]
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
resources:
2+
dashboards:
3+
this_is_a_test_dashboard:
4+
display_name: "This is a test dashboard"
5+
warehouse_id: w4r3h0us3
6+
file_path: ../dashboard/this_is_a_test_dashboard.lvdash.json
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
>>> [CLI] bundle generate dashboard --existing-path /path/to/dashboard --dashboard-dir out/dashboard --resource-dir out/resource
3+
Writing dashboard to "out/dashboard/this_is_a_test_dashboard.lvdash.json"
4+
Writing configuration to "out/resource/this_is_a_test_dashboard.dashboard.yml"

0 commit comments

Comments
 (0)