Skip to content

Commit 991f9c4

Browse files
Fix Lakebase acceptance tests for backend changes (#4746)
## Summary - Rename endpoint from `primary` to `custom` in `postgres_endpoints/basic` test to avoid conflict with the auto-created primary endpoint - Add `enable_pg_native_login` to the mock server's project response to match current backend behavior - Update golden files ## Test plan - [x] All 4 tests pass locally (both direct and terraform) - [x] All 4 tests pass on AWS cloud (direct); terraform has pre-existing provider issues unrelated to this PR This pull request was AI-assisted by Isaac.
1 parent e7c45ed commit 991f9c4

12 files changed

Lines changed: 22 additions & 13 deletions

File tree

acceptance/bundle/resources/postgres_endpoints/basic/databricks.yml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ resources:
2323
no_expiry: true
2424

2525
postgres_endpoints:
26-
primary:
26+
custom:
2727
parent: ${resources.postgres_branches.main.id}
28-
endpoint_id: primary
28+
endpoint_id: custom
2929
endpoint_type: ENDPOINT_TYPE_READ_ONLY
3030
autoscaling_limit_min_cu: 0.5
3131
autoscaling_limit_max_cu: 2

acceptance/bundle/resources/postgres_endpoints/basic/out.requests.direct.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"method": "POST",
3434
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints",
3535
"q": {
36-
"endpoint_id": "primary"
36+
"endpoint_id": "custom"
3737
},
3838
"body": {
3939
"spec": {
@@ -45,9 +45,9 @@
4545
}
4646
{
4747
"method": "GET",
48-
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/primary"
48+
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/custom"
4949
}
5050
{
5151
"method": "GET",
52-
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/primary"
52+
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/custom"
5353
}

acceptance/bundle/resources/postgres_endpoints/basic/out.requests.terraform.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"method": "POST",
3535
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints",
3636
"q": {
37-
"endpoint_id": "primary"
37+
"endpoint_id": "custom"
3838
},
3939
"body": {
4040
"parent": "projects/test-pg-proj-[UNIQUE_NAME]/branches/main",
@@ -47,5 +47,5 @@
4747
}
4848
{
4949
"method": "GET",
50-
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/primary"
50+
"path": "/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/custom"
5151
}

acceptance/bundle/resources/postgres_endpoints/basic/output.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Resources:
2020
Name:
2121
URL: (not deployed)
2222
Postgres endpoints:
23-
primary:
23+
custom:
2424
Name:
2525
URL: (not deployed)
2626
Postgres projects:
@@ -34,9 +34,9 @@ Deploying resources...
3434
Updating deployment state...
3535
Deployment complete!
3636

37-
>>> [CLI] postgres get-endpoint projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/primary
37+
>>> [CLI] postgres get-endpoint projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/custom
3838
{
39-
"name": "projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/primary",
39+
"name": "projects/test-pg-proj-[UNIQUE_NAME]/branches/main/endpoints/custom",
4040
"parent": "projects/test-pg-proj-[UNIQUE_NAME]/branches/main",
4141
"status": {
4242
"autoscaling_limit_max_cu": 2,
@@ -71,7 +71,7 @@ Resources:
7171
Name:
7272
URL: (not deployed)
7373
Postgres endpoints:
74-
primary:
74+
custom:
7575
Name:
7676
URL: (not deployed)
7777
Postgres projects:
@@ -84,7 +84,7 @@ Resources:
8484
>>> [CLI] bundle destroy --auto-approve
8585
The following resources will be deleted:
8686
delete resources.postgres_branches.main
87-
delete resources.postgres_endpoints.primary
87+
delete resources.postgres_endpoints.custom
8888
delete resources.postgres_projects.my_project
8989

9090
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/deploy-postgres-endpoint-[UNIQUE_NAME]/default

acceptance/bundle/resources/postgres_endpoints/basic/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ trace $CLI bundle deploy
1515
# Get endpoint details
1616
project_name="projects/test-pg-proj-${UNIQUE_NAME}"
1717
branch_name="${project_name}/branches/main"
18-
endpoint_name="${branch_name}/endpoints/primary"
18+
endpoint_name="${branch_name}/endpoints/custom"
1919
trace $CLI postgres get-endpoint "${endpoint_name}" | jq 'del(.create_time, .update_time)'
2020

2121
trace $CLI bundle summary

acceptance/bundle/resources/postgres_projects/basic/output.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Deployment complete!
3737
"suspend_timeout_duration": "300s"
3838
},
3939
"display_name": "Test Postgres Project",
40+
"enable_pg_native_login": true,
4041
"history_retention_duration": "604800s",
4142
"owner": "[USERNAME]",
4243
"pg_version": 16,

acceptance/bundle/resources/postgres_projects/recreate/out.get_project.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"suspend_timeout_duration":"300s"
1010
},
1111
"display_name":"Test Recreate",
12+
"enable_pg_native_login":true,
1213
"history_retention_duration":"604800s",
1314
"owner":"[USERNAME]",
1415
"pg_version":16,

acceptance/bundle/resources/postgres_projects/update_display_name/out.plan.no_change.direct.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"suspend_timeout_duration": "300s"
1212
},
1313
"display_name": "Original Name",
14+
"enable_pg_native_login": true,
1415
"history_retention_duration": "604800s",
1516
"owner": "[USERNAME]",
1617
"pg_version": 16,

acceptance/bundle/resources/postgres_projects/update_display_name/out.plan.restore.direct.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"suspend_timeout_duration": "300s"
2525
},
2626
"display_name": "Updated Name",
27+
"enable_pg_native_login": true,
2728
"history_retention_duration": "604800s",
2829
"owner": "[USERNAME]",
2930
"pg_version": 16,

acceptance/bundle/resources/postgres_projects/update_display_name/out.plan.update.direct.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"suspend_timeout_duration": "300s"
2525
},
2626
"display_name": "Original Name",
27+
"enable_pg_native_login": true,
2728
"history_retention_duration": "604800s",
2829
"owner": "[USERNAME]",
2930
"pg_version": 16,

0 commit comments

Comments
 (0)