Skip to content

go/vt/mysqlctl: run backup init sql after catchup, disable super read… #15046

go/vt/mysqlctl: run backup init sql after catchup, disable super read…

go/vt/mysqlctl: run backup init sql after catchup, disable super read… #15046

name: Vitess Tester (vtgate)
on:
push:
branches:
- "main"
- "release-[0-9]+.[0-9]"
tags: '**'
pull_request:
branches: '**'
concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Vitess Tester (vtgate)')
cancel-in-progress: true
permissions: read-all
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
jobs:
build:
name: Run endtoend tests on Vitess Tester (vtgate)
runs-on: ubuntu-24.04
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Skip CI
run: |
if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
echo "skipping CI due to the 'Skip CI' label"
exit 1
fi
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: 'false'
- name: Check for changes in relevant files
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: changes
with:
token: ''
filters: |
end_to_end:
- 'test/config.json'
- 'go/**/*.go'
- 'go/vt/sidecardb/**/*.sql'
- 'go/test/endtoend/vtgate/vitess_tester/**'
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.sum'
- 'go.mod'
- 'proto/*.proto'
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/vitess_tester_vtgate.yml'
- name: Set up Go
if: steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: ${{ (github.base_ref == 'main' || (github.base_ref == '' && github.ref_name == 'main')) && 'true' || 'false' }}
- name: Set up python
if: steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- name: Tune the OS
if: steps.changes.outputs.end_to_end == 'true'
uses: ./.github/actions/tune-os
- name: Setup MySQL
if: steps.changes.outputs.end_to_end == 'true'
uses: ./.github/actions/setup-mysql
with:
flavor: mysql-8.4
- name: Get dependencies
if: steps.changes.outputs.end_to_end == 'true'
run: |
sudo apt-get -qq update
# Install everything else we need, and configure
sudo apt-get -qq install -y make unzip g++ etcd-client etcd-server curl git wget xz-utils libncurses6
sudo service etcd stop
go mod download
# install JUnit report formatter
go install github.com/vitessio/go-junit-report@99fa7f0daf16db969f54a49139a14471e633e6e8 # HEAD
# install vitess tester
go install github.com/vitessio/vt/go/vt@e43009309f599378504905d4b804460f47822ac5
- name: Setup launchable dependencies
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
# verify that launchable setup is all correct.
launchable verify || true
# Tell Launchable about the build you are producing and testing
launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 45
run: |
# We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
# which musn't be more than 107 characters long.
export VTDATAROOT="/tmp/"
source build.env
export NOVTADMINBUILD=1
make build
set -exo pipefail
i=1
for dir in ./go/test/endtoend/vtgate/vitess_tester/*/; do
# We go over all the directories in the given path.
# If there is a vschema file there, we use it, otherwise we let vt tester autogenerate it.
if [ -f $dir/vschema.json ]; then
vt tester --xunit --vschema "$dir"vschema.json $dir/*.test
else
vt tester --sharded --xunit $dir/*.test
fi
# Number the reports by changing their file names.
mv report.xml report"$i".xml
i=$((i+1))
done
- name: Record test results in launchable if PR is not a draft
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' && !cancelled()
run: |
# send recorded tests to launchable
launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
- name: Print test output
if: steps.changes.outputs.end_to_end == 'true' && !cancelled()
run: |
# print test output
cat report*.xml
- name: Test Summary
if: steps.changes.outputs.end_to_end == 'true' && !cancelled()
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "report*.xml"
show: "fail"