Skip to content

Commit eba5146

Browse files
authored
acc: Use actual ID replacement for sql warehouse tests (#5433)
## Changes The actual ID replacement for SQL warehouse tests ## Why Fixes integration tests on Cloud Failure diff is ``` ->>> errcode [CLI] warehouses get [UUID] +>>> errcode [CLI] warehouses get f2894befa3a5ba*** ``` ## Tests Acceptance tests pass <!-- 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 dba5933 commit eba5146

6 files changed

Lines changed: 19 additions & 24 deletions

File tree

acceptance/bundle/resources/sql_warehouses/lifecycle-started-toggle/output.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Deployment complete!
2121
}
2222
{
2323
"method": "POST",
24-
"path": "/api/2.0/sql/warehouses/[UUID]/stop",
24+
"path": "/api/2.0/sql/warehouses/[WAREHOUSE_ID]/stop",
2525
"body": {}
2626
}
2727

28-
>>> errcode [CLI] warehouses get [UUID]
28+
>>> errcode [CLI] warehouses get [WAREHOUSE_ID]
2929
"STOPPED"
3030

3131
=== Toggle started=false -> started=true: only Start should be called, no Edit
@@ -40,11 +40,11 @@ Deployment complete!
4040
>>> print_requests.py //sql/warehouses
4141
{
4242
"method": "POST",
43-
"path": "/api/2.0/sql/warehouses/[UUID]/start",
43+
"path": "/api/2.0/sql/warehouses/[WAREHOUSE_ID]/start",
4444
"body": {}
4545
}
4646

47-
>>> errcode [CLI] warehouses get [UUID]
47+
>>> errcode [CLI] warehouses get [WAREHOUSE_ID]
4848
"RUNNING"
4949

5050
=== Toggle started=true -> started=false: only Stop should be called, no Edit
@@ -59,11 +59,11 @@ Deployment complete!
5959
>>> print_requests.py //sql/warehouses
6060
{
6161
"method": "POST",
62-
"path": "/api/2.0/sql/warehouses/[UUID]/stop",
62+
"path": "/api/2.0/sql/warehouses/[WAREHOUSE_ID]/stop",
6363
"body": {}
6464
}
6565

66-
>>> errcode [CLI] warehouses get [UUID]
66+
>>> errcode [CLI] warehouses get [WAREHOUSE_ID]
6767
"STOPPED"
6868

6969
>>> [CLI] bundle destroy --auto-approve

acceptance/bundle/resources/sql_warehouses/lifecycle-started-toggle/script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ trap cleanup EXIT
99
title "Deploy with started=false: warehouse created and then stopped"
1010
trace errcode $CLI bundle deploy
1111
WAREHOUSE_ID=$($CLI bundle summary -o json | jq -r '.resources.sql_warehouses.mywarehouse.id')
12+
add_repl.py "$WAREHOUSE_ID" "WAREHOUSE_ID"
1213
trace print_requests.py //sql/warehouses
1314
rm -f out.requests.txt
1415
{ trace errcode $CLI warehouses get "$WAREHOUSE_ID" | jq '.state'; } || true

acceptance/bundle/resources/sql_warehouses/lifecycle-started-toggle/test.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@ RecordRequests = true
44

55
Ignore = [".databricks", "databricks.yml"]
66

7-
[[Repls]]
8-
Old = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
9-
New = "[UUID]"
10-
117
[EnvMatrix]
128
DATABRICKS_BUNDLE_ENGINE = ["direct"]

acceptance/bundle/resources/sql_warehouses/lifecycle-started/output.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ Deployment complete!
2020
}
2121
}
2222

23-
>>> errcode [CLI] warehouses get [UUID]
23+
>>> errcode [CLI] warehouses get [WAREHOUSE_ID]
2424
"RUNNING"
2525

2626
=== Stop warehouse externally while config says started=true: plan detects drift
27-
>>> errcode [CLI] warehouses stop [UUID]
27+
>>> errcode [CLI] warehouses stop [WAREHOUSE_ID]
2828
"STOPPED"
2929

3030
>>> [CLI] bundle plan
@@ -42,20 +42,20 @@ Deployment complete!
4242
>>> print_requests.py //sql/warehouses
4343
{
4444
"method": "POST",
45-
"path": "/api/2.0/sql/warehouses/[UUID]/stop",
45+
"path": "/api/2.0/sql/warehouses/[WAREHOUSE_ID]/stop",
4646
"body": {}
4747
}
4848
{
4949
"method": "POST",
50-
"path": "/api/2.0/sql/warehouses/[UUID]/start",
50+
"path": "/api/2.0/sql/warehouses/[WAREHOUSE_ID]/start",
5151
"body": {}
5252
}
5353

54-
>>> errcode [CLI] warehouses get [UUID]
54+
>>> errcode [CLI] warehouses get [WAREHOUSE_ID]
5555
"RUNNING"
5656

5757
=== Deploy with started=false while warehouse is stopped: warehouse stays stopped
58-
>>> errcode [CLI] warehouses stop [UUID]
58+
>>> errcode [CLI] warehouses stop [WAREHOUSE_ID]
5959
"STOPPED"
6060

6161
>>> update_file.py databricks.yml started: true started: false
@@ -69,11 +69,11 @@ Deployment complete!
6969
>>> print_requests.py //sql/warehouses
7070
{
7171
"method": "POST",
72-
"path": "/api/2.0/sql/warehouses/[UUID]/stop",
72+
"path": "/api/2.0/sql/warehouses/[WAREHOUSE_ID]/stop",
7373
"body": {}
7474
}
7575

76-
>>> errcode [CLI] warehouses get [UUID]
76+
>>> errcode [CLI] warehouses get [WAREHOUSE_ID]
7777
"STOPPED"
7878

7979
=== Deploy with started=true: warehouse restarted
@@ -88,11 +88,11 @@ Deployment complete!
8888
>>> print_requests.py //sql/warehouses
8989
{
9090
"method": "POST",
91-
"path": "/api/2.0/sql/warehouses/[UUID]/start",
91+
"path": "/api/2.0/sql/warehouses/[WAREHOUSE_ID]/start",
9292
"body": {}
9393
}
9494

95-
>>> errcode [CLI] warehouses get [UUID]
95+
>>> errcode [CLI] warehouses get [WAREHOUSE_ID]
9696
"RUNNING"
9797

9898
>>> [CLI] bundle destroy --auto-approve

acceptance/bundle/resources/sql_warehouses/lifecycle-started/script

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ trap cleanup EXIT
99
title "Deploy with started=true: warehouse created and running"
1010
trace errcode $CLI bundle deploy
1111
WAREHOUSE_ID=$($CLI bundle summary -o json | jq -r '.resources.sql_warehouses.mywarehouse.id')
12+
add_repl.py "$WAREHOUSE_ID" "WAREHOUSE_ID"
13+
1214
trace print_requests.py //sql/warehouses
1315
rm -f out.requests.txt
1416
{ trace errcode $CLI warehouses get "$WAREHOUSE_ID" | jq '.state'; } || true

acceptance/bundle/resources/sql_warehouses/lifecycle-started/test.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@ RecordRequests = true
44

55
Ignore = [".databricks", "databricks.yml"]
66

7-
[[Repls]]
8-
Old = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
9-
New = "[UUID]"
10-
117
[EnvMatrix]
128
DATABRICKS_BUNDLE_ENGINE = ["direct"]

0 commit comments

Comments
 (0)