Skip to content

Commit 9429f2a

Browse files
authored
acc: Added test for new Lakeflow pipeline deployment (#3578)
## Changes Added test for new Lakeflow pipeline deployment ## Why To confirm that new Lakeflow pipelines are deployed correctly <!-- 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 f3ef15b commit 9429f2a

File tree

7 files changed

+91
-0
lines changed

7 files changed

+91
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
bundle:
2+
name: test-pipeline-lakeflow-pipeline-$UNIQUE_NAME
3+
4+
resources:
5+
pipelines:
6+
foo:
7+
name: test-pipeline-lakeflow-pipeline-$UNIQUE_NAME
8+
libraries:
9+
- glob:
10+
include: ./pipeline/transformations/**
11+
- glob:
12+
include: /Workspace/Shared/transformations/**
13+
root_path: "./pipeline/"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Local = true
2+
Cloud = true
3+
4+
[EnvMatrix]
5+
DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
>>> [CLI] bundle validate
3+
Name: test-pipeline-lakeflow-pipeline-[UNIQUE_NAME]
4+
Target: default
5+
Workspace:
6+
User: [USERNAME]
7+
Path: /Workspace/Users/[USERNAME]/.bundle/test-pipeline-lakeflow-pipeline-[UNIQUE_NAME]/default
8+
9+
Validation OK!
10+
11+
>>> [CLI] bundle deploy
12+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-lakeflow-pipeline-[UNIQUE_NAME]/default/files...
13+
Deploying resources...
14+
Updating deployment state...
15+
Deployment complete!
16+
17+
>>> jq -s .[] | select(.path=="/api/2.0/pipelines" and .method == "POST") | .body out.requests.txt
18+
{
19+
"channel": "CURRENT",
20+
"deployment": {
21+
"kind": "BUNDLE",
22+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-pipeline-lakeflow-pipeline-[UNIQUE_NAME]/default/state/metadata.json"
23+
},
24+
"edition": "ADVANCED",
25+
"libraries": [
26+
{
27+
"glob": {
28+
"include": "/Workspace/Users/[USERNAME]/.bundle/test-pipeline-lakeflow-pipeline-[UNIQUE_NAME]/default/files/pipeline/transformations/**"
29+
}
30+
},
31+
{
32+
"glob": {
33+
"include": "/Workspace/Shared/transformations/**"
34+
}
35+
}
36+
],
37+
"name": "test-pipeline-lakeflow-pipeline-[UNIQUE_NAME]",
38+
"root_path": "/Workspace/Users/[USERNAME]/.bundle/test-pipeline-lakeflow-pipeline-[UNIQUE_NAME]/default/files/pipeline"
39+
}
40+
41+
>>> [CLI] bundle destroy --auto-approve
42+
The following resources will be deleted:
43+
delete pipeline foo
44+
45+
This action will result in the deletion of the following Lakeflow Declarative Pipelines along with the
46+
Streaming Tables (STs) and Materialized Views (MVs) managed by them:
47+
delete pipeline foo
48+
49+
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-pipeline-lakeflow-pipeline-[UNIQUE_NAME]/default
50+
51+
Deleting files...
52+
Destroy complete!
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("Hello, World!")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("Hello, World!")
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
envsubst < databricks.yml.tmpl > databricks.yml
2+
trace $CLI bundle validate
3+
4+
cleanup() {
5+
trace $CLI bundle destroy --auto-approve
6+
rm out.requests.txt
7+
}
8+
trap cleanup EXIT
9+
trace $CLI bundle deploy
10+
11+
trace jq -s '.[] | select(.path=="/api/2.0/pipelines" and .method == "POST") | .body' out.requests.txt
12+
rm out.requests.txt
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Local = true
2+
Cloud = true
3+
RecordRequests = true
4+
5+
Ignore = [
6+
"databricks.yml",
7+
]

0 commit comments

Comments
 (0)