Skip to content

Add --wait to helm tests and other improvements to support CD tools #17137

Add --wait to helm tests and other improvements to support CD tools

Add --wait to helm tests and other improvements to support CD tools #17137

name: Regression Tests
on: pull_request
env:
VERSION: '1.0.0-ci'
GITHUB_TOKEN: ${{ github.token }} # necessary to pass upgrade tests
jobs:
prepare_env:
name: Prepare Environment
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
should-auto-succeed-regression-tests: ${{ steps.run-strategy.outputs.auto_succeed }}
steps:
- name: Cancel Previous Actions
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- id: checkout-code
uses: actions/checkout@v3
with:
# We require gathering the branch and tag history since we rely on a `git diff`
# which compares the state of two branches
fetch-depth: 0
- id: process-skip-directives
uses: ./.github/workflows/composite-actions/process-skip-directives
with:
base-ref: ${{ github.base_ref }}
- id: run-strategy
name: Determine Test Run Strategy
run: |
skip_kube_tests=${{ steps.process-skip-directives.outputs.skip-kube-tests }}
if [[ ! -z $skip_kube_tests && $skip_kube_tests = true ]] ; then
echo "auto_succeed=true" >> $GITHUB_OUTPUT
fi
regression_tests:
name: k8s regression tests (${{matrix.kube-e2e-test-type}})
needs: prepare_env
runs-on: ubuntu-22.04
timeout-minutes: 60
if: ${{ !github.event.pull_request.draft }}
strategy:
fail-fast: false
matrix:
# upgrade tests are run on LTS but not on main branch, for main they are run nightly
# this is the github action version of ternary op
kube-e2e-test-type: [ 'gateway', 'gloo', 'ingress', 'helm', 'gloomtls', 'glooctl', 'istio', 'upgrade' ]
kube-version: [ { node: 'v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72', kubectl: 'v1.27.3', kind: 'v0.20.0', helm: 'v3.12.2' } ]
merge-to-main:
- ${{ github.event.pull_request.base.ref == 'main' }}
exclude:
- merge-to-main: true
kube-e2e-test-type: upgrade
steps:
- uses: actions/checkout@v3
- id: run-tests
if: needs.prepare_env.outputs.should-auto-succeed-regression-tests != 'true'
uses: ./.github/workflows/composite-actions/regression-tests
- id: auto-succeed-tests
if: needs.prepare_env.outputs.should-auto-succeed-regression-tests == 'true'
run: |
echo "Regression tests auto-succeeded"