Skip to content

Commit 508d9a3

Browse files
acc: pipelines stop (#3276)
## Changes Acceptance test for pipelines stop. Run stop with and without key of pipeline name. Follows #3275 --------- Co-authored-by: Jeffery Cheng <[email protected]>
1 parent 1bf2390 commit 508d9a3

File tree

6 files changed

+67
-0
lines changed

6 files changed

+67
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
bundle:
2+
name: test-pipeline-stop
3+
4+
resources:
5+
pipelines:
6+
my_pipeline:
7+
name: test-pipeline-stop
8+
libraries:
9+
- file:
10+
path: pipeline_file.py
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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
>>> [PIPELINES] deploy
3+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-stop/default/files...
4+
Deploying resources...
5+
Updating deployment state...
6+
Deployment complete!
7+
8+
>>> [PIPELINES] run
9+
Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
10+
11+
12+
=== Stopping pipeline
13+
>>> [PIPELINES] stop
14+
Stopping my_pipeline...
15+
my_pipeline has been stopped.
16+
{
17+
"method": "POST",
18+
"path": "/api/2.0/pipelines/[UUID]/stop"
19+
}
20+
21+
=== Stopping pipeline with KEY, expect same output as without KEY
22+
>>> [PIPELINES] stop my_pipeline
23+
Stopping my_pipeline...
24+
my_pipeline has been stopped.
25+
{
26+
"method": "POST",
27+
"path": "/api/2.0/pipelines/[UUID]/stop"
28+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import dlt
2+
from pyspark.sql import SparkSession
3+
4+
5+
@dlt.table
6+
def my_table():
7+
return spark.range(10)

acceptance/pipelines/stop/script

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
print_requests() {
2+
jq --sort-keys 'select(.method != "GET" and (.path | contains("/pipelines")))' < out.requests.txt
3+
rm out.requests.txt
4+
}
5+
6+
trace $PIPELINES deploy
7+
trace $PIPELINES run
8+
rm out.requests.txt
9+
10+
title "Stopping pipeline"
11+
trace $PIPELINES stop
12+
print_requests
13+
14+
title "Stopping pipeline with KEY, expect same output as without KEY"
15+
trace $PIPELINES stop my_pipeline
16+
print_requests
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RecordRequests = true

0 commit comments

Comments
 (0)