From c2e20f42999e548d384673177a87ea604a417067 Mon Sep 17 00:00:00 2001 From: Gemma Hou Date: Thu, 28 Mar 2024 23:15:38 +0000 Subject: [PATCH] Test GH action --- .github/workflows/presubmit.yaml | 19 ++++++++++++++++++ scripts/github-actions/ga-vcr-test.sh | 29 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 scripts/github-actions/ga-vcr-test.sh diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 313a429ec1..2523018a0b 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -97,6 +97,25 @@ jobs: with: name: artifacts path: /tmp/artifacts/ + vcr-tests: + runs-on: ubuntu-22.04 + timeout-minutes: 60 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: "1.21.5" + - name: "Run vcr tests" + run: | + ./scripts/github-actions/ga-vcr-test.sh + env: + GOPATH: /home/runner/go + ARTIFACTS: /tmp/artifacts + - name: "Upload artifacts" + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: /tmp/artifacts/ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} diff --git a/scripts/github-actions/ga-vcr-test.sh b/scripts/github-actions/ga-vcr-test.sh new file mode 100755 index 0000000000..b1cb98c784 --- /dev/null +++ b/scripts/github-actions/ga-vcr-test.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -o errexit +set -o nounset +set -o pipefail +REPO_ROOT="$(git rev-parse --show-toplevel)" +source ${REPO_ROOT}/scripts/shared-vars-public.sh +cd ${REPO_ROOT} +source ${REPO_ROOT}/scripts/fetch_ext_bins.sh && \ + fetch_tools && \ + setup_envs + +cd ${REPO_ROOT}/ +echo "Running e2e vcr tests..." +E2E_KUBE_TARGET=envtest \ + RUN_E2E=1 E2E_GCP_TARGET=vcr VCR_MODE=record \ + go test -test.count=1 -timeout 3600s -v ./tests/e2e -run TestAllInSeries/fixtures/computenodetemplate 2>&1 \ No newline at end of file