Skip to content

Commit 2ad2c27

Browse files
committed
fix(integration_tests): use correct alert types
1 parent dbd80ef commit 2ad2c27

File tree

3 files changed

+6
-47
lines changed

3 files changed

+6
-47
lines changed

integration_test/cloudbuild.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,7 @@ steps:
130130
131131
node scripts/run-tests.js \
132132
--sequential \
133-
v2_firestore \
134-
v2_database \
135-
v2_pubsub \
136-
v2_storage \
137-
v2_scheduler \
138-
v2_tasks \
139-
v2_eventarc \
140133
v2_alerts \
141-
v2_testlab \
142-
v2_remoteconfig \
143134
--use-published-sdk=file:$$WHEEL_FILE
144135
145136
# Artifacts to store

integration_test/config/suites.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ suites:
181181
functions:
182182
- name: alertsOnAlertPublished
183183
trigger: onAlertPublished
184-
alertType: "billing.planAutomatedUpdatePublished"
184+
alertType: "billing.planAutomatedUpdate"
185185

186186
# V2 Test Lab triggers
187187
- name: v2_testlab

integration_test/scripts/run-tests.js

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -596,46 +596,14 @@ class TestRunner {
596596

597597
// If not deleted yet, try alternative methods
598598
if (!deleted) {
599-
// For v2 functions, try to delete the Cloud Run service directly
599+
// For v2 functions, use gcloud functions delete with --gen2 flag
600600
if (metadata.projectId === "functions-integration-tests-v2") {
601-
this.log(` Attempting Cloud Run service deletion for v2 function...`, "warn");
602-
// Cloud Run service names are lowercase
603-
const cloudRunServiceName = functionName.toLowerCase();
604-
try {
605-
await this.exec(
606-
`gcloud run services delete ${cloudRunServiceName} --region=${
607-
metadata.region || DEFAULT_REGION
608-
} --project=${metadata.projectId} --quiet`,
609-
{ silent: true }
610-
);
611-
612-
// Verify deletion
613-
try {
614-
await this.exec(
615-
`gcloud run services describe ${cloudRunServiceName} --region=${
616-
metadata.region || DEFAULT_REGION
617-
} --project=${metadata.projectId}`,
618-
{ silent: true }
619-
);
620-
// If describe succeeds, function still exists
621-
this.log(` ⚠️ Cloud Run service still exists after deletion: ${functionName}`, "warn");
622-
} catch {
623-
// If describe fails, function was deleted
624-
this.log(` ✅ Deleted function as Cloud Run service: ${functionName}`, "success");
625-
deleted = true;
626-
}
627-
} catch (runError) {
628-
this.log(` ⚠️ Cloud Run delete failed: ${runError.message}`, "warn");
629-
}
630-
}
631-
632-
// If still not deleted, try gcloud functions delete as last resort
633-
if (!deleted) {
601+
this.log(` Attempting gcloud functions delete with --gen2 flag...`, "warn");
634602
try {
635603
await this.exec(
636604
`gcloud functions delete ${functionName} --region=${
637605
metadata.region || DEFAULT_REGION
638-
} --project=${metadata.projectId} --quiet`,
606+
} --project=${metadata.projectId} --gen2 --quiet`,
639607
{ silent: true }
640608
);
641609

@@ -644,15 +612,15 @@ class TestRunner {
644612
await this.exec(
645613
`gcloud functions describe ${functionName} --region=${
646614
metadata.region || DEFAULT_REGION
647-
} --project=${metadata.projectId}`,
615+
} --project=${metadata.projectId} --gen2`,
648616
{ silent: true }
649617
);
650618
// If describe succeeds, function still exists
651619
this.log(` ⚠️ Function still exists after gcloud delete: ${functionName}`, "warn");
652620
deleted = false;
653621
} catch {
654622
// If describe fails, function was deleted
655-
this.log(` ✅ Deleted function via gcloud: ${functionName}`, "success");
623+
this.log(` ✅ Deleted function via gcloud gen2: ${functionName}`, "success");
656624
deleted = true;
657625
}
658626
} catch (e) {

0 commit comments

Comments
 (0)