Skip to content

Commit 90bb920

Browse files
committed
try new project for ear
1 parent 6fe7345 commit 90bb920

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

internal/testutil/acc/encryption_at_rest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func EncryptionAtRestExecution(tb testing.TB) string {
164164
SkipInUnitTest(tb)
165165
require.True(tb, sharedInfo.init, "SetupSharedResources must called from TestMain test package")
166166

167-
projectID := ProjectIDExecution(tb)
167+
projectID := createProject(tb, "encryption-at-rest-delete-on-create-timeout-test")
168168

169169
sharedInfo.mu.Lock()
170170
defer sharedInfo.mu.Unlock()

internal/testutil/acc/shared_resource.go

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,21 @@ func cleanupSharedResources() {
5353
deletePrivateLinkEndpoint(projectID, sharedInfo.privateLinkProviderName, sharedInfo.privateLinkEndpointID)
5454
}
5555
if sharedInfo.encryptionAtRestEnabled {
56-
projectID := sharedInfo.projectID
56+
projectID := sharedInfo.encryptionAtRestProjectID
5757
if projectID == "" {
58-
projectID = projectIDLocal()
58+
projectID = sharedInfo.projectID
59+
if projectID == "" {
60+
projectID = projectIDLocal()
61+
}
5962
}
6063
fmt.Printf("Deleting execution encryption at rest: project id: %s\n", projectID)
6164
deleteEncryptionAtRest(projectID)
65+
66+
// If we created a dedicated project, delete it
67+
if sharedInfo.encryptionAtRestProjectID != "" && sharedInfo.encryptionAtRestProjectID != sharedInfo.projectID {
68+
fmt.Printf("Deleting execution encryption at rest project: %s, id: %s\n", sharedInfo.encryptionAtRestProjectName, sharedInfo.encryptionAtRestProjectID)
69+
deleteProject(sharedInfo.encryptionAtRestProjectID)
70+
}
6271
}
6372
if sharedInfo.projectID != "" {
6473
fmt.Printf("Deleting execution project: %s, id: %s\n", sharedInfo.projectName, sharedInfo.projectID)
@@ -216,17 +225,19 @@ type projectInfo struct {
216225
}
217226

218227
var sharedInfo = struct {
219-
projectID string
220-
projectName string
221-
clusterName string
222-
streamInstanceName string
223-
privateLinkEndpointID string
224-
privateLinkProviderName string
225-
projects []projectInfo
226-
mu sync.Mutex
227-
muSleep sync.Mutex
228-
encryptionAtRestEnabled bool
229-
init bool
228+
encryptionAtRestProjectName string
229+
projectName string
230+
clusterName string
231+
streamInstanceName string
232+
privateLinkEndpointID string
233+
privateLinkProviderName string
234+
projectID string
235+
encryptionAtRestProjectID string
236+
projects []projectInfo
237+
mu sync.Mutex
238+
muSleep sync.Mutex
239+
encryptionAtRestEnabled bool
240+
init bool
230241
}{
231242
projects: []projectInfo{},
232243
}

0 commit comments

Comments
 (0)