Skip to content

Commit 82fc136

Browse files
Lionel-Wilsonactions-user
authored andcommitted
Eng 3456 fix azure integration test federated identity failure (#4820)
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > Low risk: changes are limited to CI configuration and integration test execution flow, mainly improving reliability and avoiding false failures when setup is skipped or incomplete. > > **Overview** > Improves Azure integration test reliability by **injecting PostgreSQL Flexible Server admin credentials** into the CI secret set and **increasing the weekly workflow test timeout** to 120 minutes. > > Updates several Azure integration tests to **skip the `Run` subtests unless `Setup` completed successfully**, avoiding downstream failures when resource provisioning is skipped/aborted (including simplifying the flow log test’s prior preflight check). > > Separately, the docs link checker config now excludes `cloud.google.com` URLs to avoid lychee redirect-follow issues. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7c55da628d3773524b284824e8eafacbe728c7bc. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> GitOrigin-RevId: e5e7357ae8194d3377e756f0424561b8eb5a0bbc
1 parent 4c44e55 commit 82fc136

4 files changed

Lines changed: 30 additions & 8 deletions

File tree

sources/azure/integration-tests/dbforpostgresql-database_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ func TestDBforPostgreSQLDatabaseIntegration(t *testing.T) {
6262
// Generate unique PostgreSQL server name (must be globally unique, lowercase, no special chars)
6363
postgreSQLServerName := generatePostgreSQLServerName(integrationTestPostgreSQLServerName)
6464

65+
setupCompleted := false
66+
6567
t.Run("Setup", func(t *testing.T) {
6668
ctx := t.Context()
6769

@@ -94,9 +96,15 @@ func TestDBforPostgreSQLDatabaseIntegration(t *testing.T) {
9496
if err != nil {
9597
t.Fatalf("Failed waiting for PostgreSQL database to be available: %v", err)
9698
}
99+
100+
setupCompleted = true
97101
})
98102

99103
t.Run("Run", func(t *testing.T) {
104+
if !setupCompleted {
105+
t.Skip("Skipping Run: Setup did not complete successfully")
106+
}
107+
100108
t.Run("GetPostgreSQLDatabase", func(t *testing.T) {
101109
ctx := t.Context()
102110

sources/azure/integration-tests/dbforpostgresql-flexible-server-backup_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ func TestDBforPostgreSQLFlexibleServerBackupIntegration(t *testing.T) {
5757

5858
pgServerName := generatePostgreSQLServerName(integrationTestPGBackupServerName)
5959

60+
setupCompleted := false
61+
6062
t.Run("Setup", func(t *testing.T) {
6163
ctx := t.Context()
6264

@@ -84,9 +86,15 @@ func TestDBforPostgreSQLFlexibleServerBackupIntegration(t *testing.T) {
8486
if err != nil {
8587
t.Fatalf("Failed waiting for backup to be available: %v", err)
8688
}
89+
90+
setupCompleted = true
8791
})
8892

8993
t.Run("Run", func(t *testing.T) {
94+
if !setupCompleted {
95+
t.Skip("Skipping Run: Setup did not complete successfully")
96+
}
97+
9098
t.Run("GetPostgreSQLFlexibleServerBackup", func(t *testing.T) {
9199
ctx := t.Context()
92100

sources/azure/integration-tests/dbforpostgresql-flexible-server_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ func TestDBforPostgreSQLFlexibleServerIntegration(t *testing.T) {
4949
// Generate unique PostgreSQL server name (must be globally unique, lowercase, no special chars)
5050
postgreSQLServerName := generatePostgreSQLServerName(integrationTestPostgreSQLFlexibleServerName)
5151

52+
setupCompleted := false
53+
5254
t.Run("Setup", func(t *testing.T) {
5355
ctx := t.Context()
5456

@@ -69,9 +71,15 @@ func TestDBforPostgreSQLFlexibleServerIntegration(t *testing.T) {
6971
if err != nil {
7072
t.Fatalf("Failed waiting for PostgreSQL server to be available: %v", err)
7173
}
74+
75+
setupCompleted = true
7276
})
7377

7478
t.Run("Run", func(t *testing.T) {
79+
if !setupCompleted {
80+
t.Skip("Skipping Run: Setup did not complete successfully")
81+
}
82+
7583
t.Run("GetPostgreSQLFlexibleServer", func(t *testing.T) {
7684
ctx := t.Context()
7785

sources/azure/integration-tests/network-flow-log_test.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ func TestNetworkFlowLogIntegration(t *testing.T) {
6464
t.Fatalf("Failed to create Flow Logs client: %v", err)
6565
}
6666

67+
setupCompleted := false
68+
6769
t.Run("Setup", func(t *testing.T) {
6870
ctx := t.Context()
6971

@@ -109,17 +111,13 @@ func TestNetworkFlowLogIntegration(t *testing.T) {
109111
if err != nil {
110112
t.Fatalf("Failed waiting for flow log: %v", err)
111113
}
114+
115+
setupCompleted = true
112116
})
113117

114118
t.Run("Run", func(t *testing.T) {
115-
ctx := t.Context()
116-
_, checkErr := flowLogsSDKClient.Get(ctx, integrationTestNetworkWatcherRG, integrationTestNetworkWatcherName, integrationTestFlowLogName, nil)
117-
if checkErr != nil {
118-
var respErr *azcore.ResponseError
119-
if errors.As(checkErr, &respErr) && respErr.StatusCode == http.StatusNotFound {
120-
t.Skipf("Flow log %s does not exist (Setup may have been skipped). Skipping Run tests.", integrationTestFlowLogName)
121-
}
122-
t.Fatalf("Failed preflight check for flow log %s: %v", integrationTestFlowLogName, checkErr)
119+
if !setupCompleted {
120+
t.Skip("Skipping Run: Setup did not complete successfully")
123121
}
124122

125123
t.Run("GetFlowLog", func(t *testing.T) {

0 commit comments

Comments
 (0)