|
| 1 | +# Copyright 2026 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +steps: |
| 16 | + # Wait for the images to exist |
| 17 | + - name: docker:28 |
| 18 | + id: wait-for-images |
| 19 | + entrypoint: "sh" |
| 20 | + timeout: 15m |
| 21 | + env: |
| 22 | + - "_TEST_SERVER_IMAGE=${_TEST_SERVER_IMAGE}" |
| 23 | + - "_TEST_RUNNER_IMAGE=${_TEST_RUNNER_IMAGE}" |
| 24 | + args: |
| 25 | + - -c |
| 26 | + - | |
| 27 | + while true; do |
| 28 | + if docker manifest inspect ${_TEST_SERVER_IMAGE} > /dev/null && docker manifest inspect ${_TEST_RUNNER_IMAGE} > /dev/null; then |
| 29 | + echo "Images are available, continuing onto test" |
| 30 | + break |
| 31 | + else |
| 32 | + echo "Images not available yet, will continue to retry" |
| 33 | + fi |
| 34 | + sleep 5 |
| 35 | + done |
| 36 | +
|
| 37 | + # Clone repo and zip code |
| 38 | + - name: gcr.io/cloud-builders/git |
| 39 | + entrypoint: 'bash' |
| 40 | + args: |
| 41 | + - '-c' |
| 42 | + - | |
| 43 | + git clone https://github.com/GoogleCloudPlatform/opentelemetry-operations-go.git |
| 44 | + cd opentelemetry-operations-go |
| 45 | + LATEST_TAG=$$(git describe --tags $$(git rev-list --tags --max-count=1)) |
| 46 | + git checkout $$LATEST_TAG |
| 47 | + - name: golang:1.25.5 |
| 48 | + id: zip-code |
| 49 | + entrypoint: /bin/bash |
| 50 | + args: |
| 51 | + - '-c' |
| 52 | + - | |
| 53 | + apt-get update && \ |
| 54 | + apt-get install zip --assume-yes && \ |
| 55 | + cd opentelemetry-operations-go/e2e-test-server/cloud_functions/ && \ |
| 56 | + go mod vendor && \ |
| 57 | + zip -r function-source * |
| 58 | +
|
| 59 | + # Run the test |
| 60 | + - name: $_TEST_RUNNER_IMAGE |
| 61 | + id: run-tests-cloudfunctions |
| 62 | + dir: / |
| 63 | + timeout: 1800s |
| 64 | + env: ["PROJECT_ID=$PROJECT_ID"] |
| 65 | + args: |
| 66 | + - cloud-functions-gen2 |
| 67 | + - --runtime=go125 |
| 68 | + - --functionsource=/workspace/opentelemetry-operations-go/e2e-test-server/cloud_functions/function-source.zip |
| 69 | + - --entrypoint=HandleCloudFunction |
| 70 | + |
| 71 | +logsBucket: gs://opentelemetry-ops-e2e-cloud-build-logs |
| 72 | +substitutions: |
| 73 | + _TEST_RUNNER_IMAGE: us-central1-docker.pkg.dev/${PROJECT_ID}/e2e-testing/opentelemetry-operations-e2e-testing:${SHORT_SHA} |
| 74 | + _TEST_SERVER_IMAGE: us-central1-docker.pkg.dev/${PROJECT_ID}/e2e-testing/opentelemetry-operations-go-e2e-test-server:${SHORT_SHA} |
0 commit comments