Skip to content

Commit 645f2bb

Browse files
committed
capture create-pipeline requests in the acceptance test
1 parent 9205302 commit 645f2bb

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

acceptance/bundle/deploy/pipeline/allow-duplicate-names/output.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,43 @@ Deploying resources...
55
Updating deployment state...
66
Deployment complete!
77

8+
>>> print_requests
9+
{
10+
"body": {
11+
"libraries": [
12+
{
13+
"file": {
14+
"path": "/some-script.py"
15+
}
16+
}
17+
],
18+
"name": "test-pipeline-same-name-[UNIQUE_NAME]"
19+
},
20+
"method": "POST",
21+
"path": "/api/2.0/pipelines"
22+
}
23+
{
24+
"body": {
25+
"allow_duplicate_names": true,
26+
"channel": "CURRENT",
27+
"deployment": {
28+
"kind": "BUNDLE",
29+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/acc-bundle-deploy-pipeline-duplicate-names-[UNIQUE_NAME]/default/state/metadata.json"
30+
},
31+
"edition": "ADVANCED",
32+
"libraries": [
33+
{
34+
"file": {
35+
"path": "/Workspace/Users/[USERNAME]/.bundle/acc-bundle-deploy-pipeline-duplicate-names-[UNIQUE_NAME]/default/files/foo.py"
36+
}
37+
}
38+
],
39+
"name": "test-pipeline-same-name-[UNIQUE_NAME]"
40+
},
41+
"method": "POST",
42+
"path": "/api/2.0/pipelines"
43+
}
44+
845
>>> [CLI] bundle destroy --auto-approve
946
The following resources will be deleted:
1047
delete pipeline pipeline_one

acceptance/bundle/deploy/pipeline/allow-duplicate-names/script

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ touch foo.py
55
cleanup() {
66
trace $CLI bundle destroy --auto-approve
77
trace $CLI pipelines delete ${PIPELINE_ID}
8+
rm out.requests.txt
89
}
910
trap cleanup EXIT
1011

@@ -14,3 +15,8 @@ export PIPELINE_ID
1415

1516
# Deploy the bundle that has a pipeline with the same name:
1617
trace $CLI bundle deploy
18+
19+
print_requests() {
20+
jq --sort-keys 'select(.method != "GET" and (.path | contains("/pipelines")))' < out.requests.txt
21+
}
22+
trace print_requests
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Cloud = true
22
Ignore = ["foo.py","pipeline.json"]
3+
RecordRequests = true

0 commit comments

Comments
 (0)