Skip to content

Commit 8801366

Browse files
authored
acc: Added test for generating pipeline with SQL files (#3372)
## Changes Added test for generating pipeline with SQL files ## Why For #3071 ## Tests <!-- How have you tested the changes? --> <!-- 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 d13598f commit 8801366

File tree

7 files changed

+68
-0
lines changed

7 files changed

+68
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bundle:
2+
name: generate-pipeline
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resources:
2+
pipelines:
3+
out:
4+
name: generate-pipeline
5+
clusters:
6+
- custom_tags:
7+
"Tag1": "24X7-1234"
8+
- spark_conf:
9+
"spark.databricks.delta.preview.enabled": "true"
10+
libraries:
11+
- file:
12+
path: outsql.sql
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
File successfully saved to outsql.sql
2+
Pipeline configuration successfully saved to out.pipeline.yml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT * FROM test
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$CLI bundle generate pipeline --existing-pipeline-id 1234 --config-dir . --key out --force --source-dir .
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[[Server]]
2+
Pattern = "GET /api/2.0/pipelines/1234"
3+
Response.Body = '''
4+
{
5+
"pipeline_id": 1234,
6+
"spec": {
7+
"name": "generate-pipeline",
8+
"clusters": [
9+
{
10+
"custom_tags": {
11+
"Tag1": "24X7-1234"
12+
}
13+
},
14+
{
15+
"spark_conf": {
16+
"spark.databricks.delta.preview.enabled": "true"
17+
}
18+
}
19+
],
20+
"libraries": [
21+
{
22+
"file": {
23+
"path": "/Workspace/Users/[email protected]/outsql.sql"
24+
}
25+
}
26+
]
27+
}
28+
}
29+
'''
30+
31+
[[Server]]
32+
Pattern = "GET /api/2.0/workspace/get-status"
33+
Response.Body = '''
34+
{
35+
"path": "/Workspace/Users/[email protected]/outsql.sql",
36+
"object_type": "FILE",
37+
"language": "SQL"
38+
}
39+
'''
40+
41+
[[Server]]
42+
Pattern = "GET /api/2.0/workspace/export"
43+
Response.Body = '''
44+
SELECT * FROM test
45+
'''

0 commit comments

Comments
 (0)