Skip to content

Merge pull request #815 from planetscale/update_operator_yaml #50

Merge pull request #815 from planetscale/update_operator_yaml

Merge pull request #815 from planetscale/update_operator_yaml #50

name: end-to-end-test
on:
push:
branches:
- main
- release-**
pull_request:
branches:
- main
- release-**
permissions:
contents: read
jobs:
test:
name: ${{ matrix.name }}
runs-on: vitess-operator-runner
timeout-minutes: ${{ matrix.timeout_minutes || 25 }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.make_target }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
include:
- name: Upgrade Test
make_target: upgrade-test
timeout_minutes: 35
- name: Backup Restore Test
make_target: backup-restore-test
- name: Backup Schedule Cluster/Keyspace Scope Test
make_target: backup-schedule-keyspace-test
- name: Backup Schedule Test
make_target: backup-schedule-test
- name: Backup Schedule vtctldclient Method Test
make_target: backup-schedule-vtctldclient-test
- name: VTOrc and VTAdmin Test
make_target: vtorc-vtadmin-test
- name: Unmanaged Tablet Test
make_target: unmanaged-tablet-test
- name: HPA Test
make_target: hpa-test
steps:
# Ubuntu 24.04 restricts unprivileged user namespaces and ships tight
# inotify limits, both of which break mysqld inside kind.
- name: Prepare runner for kind
run: |
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 || true
sudo sysctl -w kernel.unprivileged_userns_clone=1 || true
sudo sysctl -w user.max_user_namespaces=65536 || true
sudo sysctl -w fs.inotify.max_user_watches=524288
sudo sysctl -w fs.inotify.max_user_instances=512
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Cache test binaries
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: tools/_bin
key: e2e-deps-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('tools/get-e2e-test-deps.sh', 'tools/install-kubectl.sh') }}
- name: Install test dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends mysql-client
- name: Install Chromium
if: matrix.make_target == 'vtorc-vtadmin-test'
run: |
curl --fail --location --silent --show-error \
--output /tmp/google-chrome.deb \
https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get install -y --no-install-recommends /tmp/google-chrome.deb
sudo ln -sf /usr/bin/google-chrome-stable /usr/local/bin/chromium
# BuildKit can't start build containers once AppArmor is torn down, so
# build the image first; setupBuildContainerImage skips the rebuild.
- name: Build operator image
run: docker build --progress plain -f build/Dockerfile.release -t vitess-operator-pr:latest .
# AppArmor's docker-default profile kills mysqld inside vttablet pods.
- name: Disable AppArmor
run: |
sudo systemctl stop apparmor.service || true
sudo aa-teardown || true
- name: Run ${{ matrix.name }}
run: make ${{ matrix.make_target }}
- name: Dump cluster state on failure
if: failure()
run: |
export PATH="$PWD/tools/_bin:$PATH"
kubectl get pods -A -o wide || true
kubectl get events -A --sort-by=.lastTimestamp | tail -40 || true
kubectl describe pods -n example || true
kubectl logs -n default -l app=vitess-operator --tail=100 || true
kubectl get pods -n example -o name | while read -r pod; do
echo "=== ${pod} logs ==="
kubectl logs -n example "${pod}" --all-containers --tail=50 || true
kubectl logs -n example "${pod}" --all-containers --tail=50 --previous 2>/dev/null || true
done
docker ps -a || true