diff --git a/.github/config/nodejs-dev.jsonc b/.github/config/nodejs-dev.jsonc index 7b0ae5e58f..5aaf98c432 100644 --- a/.github/config/nodejs-dev.jsonc +++ b/.github/config/nodejs-dev.jsonc @@ -111,6 +111,7 @@ "endpoints/getting-started-grpc", "error-reporting", "eventarc/generic", + "eventarc/pubsub", "functions/concepts/afterResponse", "functions/concepts/afterTimeout", "functions/concepts/backgroundTermination", diff --git a/.github/config/nodejs-prod.jsonc b/.github/config/nodejs-prod.jsonc index 3905350ced..e53e341276 100644 --- a/.github/config/nodejs-prod.jsonc +++ b/.github/config/nodejs-prod.jsonc @@ -86,7 +86,6 @@ "dlp", // [ERR_REQUIRE_ESM]: require() of ES Module "document-ai", // [ERR_REQUIRE_ESM]: require() of ES Module "eventarc/audit-storage", // (untested) Environment Variable 'SERVICE_NAME' not found - "eventarc/pubsub", // (untested) Environment Variable 'SERVICE_NAME' not found "functions/billing", // Error: Request failed with status code 500 "functions/http/uploadFile", // npm error Missing script: "test" "functions/imagemagick", // Error: A bucket name is needed to use Cloud Storage diff --git a/eventarc/pubsub/ci-setup.json b/eventarc/pubsub/ci-setup.json new file mode 100644 index 0000000000..bbae5dca43 --- /dev/null +++ b/eventarc/pubsub/ci-setup.json @@ -0,0 +1,6 @@ +{ + "env": { + "SERVICE_NAME": "eventarc-pubsub-${RUN_ID}", + "CONTAINER_IMAGE": "gcr.io/long-door-651/eventarc-pubsub:${RUN_ID}" + } +} diff --git a/eventarc/pubsub/test/deploy.sh b/eventarc/pubsub/test/deploy.sh index ede02cb088..c90f101106 100755 --- a/eventarc/pubsub/test/deploy.sh +++ b/eventarc/pubsub/test/deploy.sh @@ -22,6 +22,7 @@ requireEnv() { requireEnv SERVICE_NAME requireEnv CONTAINER_IMAGE +requireEnv SERVICE_ACCOUNT # Build the service set -x @@ -35,6 +36,8 @@ gcloud run deploy "${SERVICE_NAME}" \ --region="${REGION:-us-central1}" \ ${FLAGS} \ --platform=managed \ + --service-account="${SERVICE_ACCOUNT}" \ + --add-custom-audiences="https://action.test/" \ --quiet set +x diff --git a/eventarc/pubsub/test/runner.sh b/eventarc/pubsub/test/runner.sh index 9726e03eb8..9ceed7711b 100755 --- a/eventarc/pubsub/test/runner.sh +++ b/eventarc/pubsub/test/runner.sh @@ -20,6 +20,9 @@ requireEnv() { test "${!1}" || (echo "Environment Variable '$1' not found" && exit 1) } requireEnv SERVICE_NAME +requireEnv CONTAINER_IMAGE +requireEnv SERVICE_ACCOUNT +requireEnv ID_TOKEN echo '---' test/deploy.sh @@ -33,14 +36,11 @@ echo function cleanup { set -x gcloud run services delete ${SERVICE_NAME} \ - --platform=managed \ --region="${REGION:-us-central1}" \ --quiet } trap cleanup EXIT -# TODO: Perform authentication inside the test. -export ID_TOKEN=$(gcloud auth print-identity-token) export BASE_URL=$(test/url.sh) test -z "$BASE_URL" && echo "BASE_URL value is empty" && exit 1