Skip to content

Commit 8d0de16

Browse files
committed
fix(integration_test): create bucket for results if doesn't exist
1 parent ecb4b21 commit 8d0de16

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

integration_test/cloudbuild-v1.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ options:
88
timeout: "3600s"
99

1010
steps:
11+
# Create storage bucket for test results if it doesn't exist
12+
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk:stable"
13+
id: "create-bucket"
14+
entrypoint: "bash"
15+
args:
16+
- "-c"
17+
- |
18+
# Create bucket for test results if it doesn't exist
19+
BUCKET_NAME="gs://functions-integration-tests-test-results"
20+
echo "Checking if bucket $$BUCKET_NAME exists..."
21+
if ! gsutil ls "$$BUCKET_NAME" &>/dev/null; then
22+
echo "Creating bucket $$BUCKET_NAME..."
23+
gsutil mb -p "functions-integration-tests" "$$BUCKET_NAME"
24+
else
25+
echo "Bucket $$BUCKET_NAME already exists"
26+
fi
27+
1128
# Build SDK and run all V1 test suites sequentially
1229
- name: "node:20"
1330
id: "build-sdk-and-test-v1"
@@ -43,6 +60,6 @@ steps:
4360
# Artifacts to store
4461
artifacts:
4562
objects:
46-
location: "gs://${PROJECT_ID}-test-results/${BUILD_ID}"
63+
location: "gs://functions-integration-tests-test-results/${BUILD_ID}"
4764
paths:
4865
- "logs/**/*.log"

integration_test/cloudbuild-v2.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ options:
88
timeout: "3600s"
99

1010
steps:
11+
# Create storage bucket for test results if it doesn't exist
12+
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk:stable"
13+
id: "create-bucket"
14+
entrypoint: "bash"
15+
args:
16+
- "-c"
17+
- |
18+
# Create bucket for test results if it doesn't exist
19+
BUCKET_NAME="gs://functions-integration-tests-v2-test-results"
20+
echo "Checking if bucket $$BUCKET_NAME exists..."
21+
if ! gsutil ls "$$BUCKET_NAME" &>/dev/null; then
22+
echo "Creating bucket $$BUCKET_NAME..."
23+
gsutil mb -p "functions-integration-tests-v2" "$$BUCKET_NAME"
24+
else
25+
echo "Bucket $$BUCKET_NAME already exists"
26+
fi
27+
1128
# Build SDK and run all V2 test suites sequentially
1229
# Using the official Google Cloud SDK image which includes gcloud pre-installed
1330
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk:stable"
@@ -58,6 +75,6 @@ steps:
5875
# Artifacts to store
5976
artifacts:
6077
objects:
61-
location: "gs://${PROJECT_ID}-test-results/${BUILD_ID}"
78+
location: "gs://functions-integration-tests-v2-test-results/${BUILD_ID}"
6279
paths:
6380
- "logs/**/*.log"

0 commit comments

Comments
 (0)