Skip to content

Commit 621df37

Browse files
acceptance: add default_branch to postgres project test outputs (#5107)
## Summary The Lakebase postgres API now returns `\"default_branch\": \"<project>/branches/production\"` in `ProjectStatus`. Update the testserver mock to populate the field on project create and regenerate the affected acceptance test outputs (basic, recreate, update_display_name) so the tests pass against both the local testserver and a real cloud workspace. This was failing in nightly runs on aws-prod-ucws. ## Test plan - [x] \`go test ./acceptance -run TestAccept/bundle/resources/postgres_projects\` passes locally - [x] Verified all 8 subtests pass on aws-prod-ucws This pull request was AI-assisted by Isaac.
1 parent 1b1ad15 commit 621df37

7 files changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Deployment complete!
3131
"name": "projects/test-pg-proj-[UNIQUE_NAME]",
3232
"status": {
3333
"branch_logical_size_limit_bytes": [NUMID],
34+
"default_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production",
3435
"default_endpoint_settings": {
3536
"autoscaling_limit_max_cu": 4,
3637
"autoscaling_limit_min_cu": 0.5,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"name": "[MY_PROJECT_ID_2]",
44
"status": {
55
"branch_logical_size_limit_bytes": [NUMID],
6+
"default_branch": "[MY_PROJECT_ID_2]/branches/production",
67
"default_endpoint_settings": {
78
"autoscaling_limit_max_cu": 4,
89
"autoscaling_limit_min_cu": 0.5,

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
@@ -5,6 +5,7 @@
55
"name": "[MY_PROJECT_ID]",
66
"status": {
77
"branch_logical_size_limit_bytes": [NUMID],
8+
"default_branch": "[MY_PROJECT_ID]/branches/production",
89
"default_endpoint_settings": {
910
"autoscaling_limit_max_cu": 4,
1011
"autoscaling_limit_min_cu": 0.5,

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
@@ -18,6 +18,7 @@
1818
"name": "[MY_PROJECT_ID]",
1919
"status": {
2020
"branch_logical_size_limit_bytes": [NUMID],
21+
"default_branch": "[MY_PROJECT_ID]/branches/production",
2122
"default_endpoint_settings": {
2223
"autoscaling_limit_max_cu": 4,
2324
"autoscaling_limit_min_cu": 0.5,

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
@@ -18,6 +18,7 @@
1818
"name": "[MY_PROJECT_ID]",
1919
"status": {
2020
"branch_logical_size_limit_bytes": [NUMID],
21+
"default_branch": "[MY_PROJECT_ID]/branches/production",
2122
"default_endpoint_settings": {
2223
"autoscaling_limit_max_cu": 4,
2324
"autoscaling_limit_min_cu": 0.5,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Deployment complete!
2929
"name": "[MY_PROJECT_ID]",
3030
"status": {
3131
"branch_logical_size_limit_bytes": [NUMID],
32+
"default_branch": "[MY_PROJECT_ID]/branches/production",
3233
"default_endpoint_settings": {
3334
"autoscaling_limit_max_cu": 4,
3435
"autoscaling_limit_min_cu": 0.5,
@@ -100,6 +101,7 @@ Deployment complete!
100101
"name": "[MY_PROJECT_ID]",
101102
"status": {
102103
"branch_logical_size_limit_bytes": [NUMID],
104+
"default_branch": "[MY_PROJECT_ID]/branches/production",
103105
"default_endpoint_settings": {
104106
"autoscaling_limit_max_cu": 4,
105107
"autoscaling_limit_min_cu": 0.5,
@@ -138,6 +140,7 @@ Deployment complete!
138140
"name": "[MY_PROJECT_ID]",
139141
"status": {
140142
"branch_logical_size_limit_bytes": [NUMID],
143+
"default_branch": "[MY_PROJECT_ID]/branches/production",
141144
"default_endpoint_settings": {
142145
"autoscaling_limit_max_cu": 4,
143146
"autoscaling_limit_min_cu": 0.5,

libs/testserver/postgres.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func (s *FakeWorkspace) PostgresProjectCreate(req Request, projectID string) Res
7474
// Copy spec fields to status (API returns status as materialized view)
7575
if project.Spec != nil {
7676
project.Status = &postgres.ProjectStatus{
77+
DefaultBranch: name + "/branches/production",
7778
DisplayName: project.Spec.DisplayName,
7879
PgVersion: project.Spec.PgVersion,
7980
HistoryRetentionDuration: project.Spec.HistoryRetentionDuration,

0 commit comments

Comments
 (0)