From a97c08fbf6d616c93f47c9a4f0eeb26ec8cedc2d Mon Sep 17 00:00:00 2001 From: Arthur Schreiber Date: Thu, 30 Oct 2025 17:03:41 +0000 Subject: [PATCH 1/5] Can we use a matrix build here? Signed-off-by: Arthur Schreiber --- .github/workflows/unit_race.yml | 143 ----------------- .../{unit_test_mysql57.yml => unit_test.yml} | 14 +- .github/workflows/unit_test_mysql80.yml | 149 ------------------ .github/workflows/unit_test_mysql84.yml | 149 ------------------ 4 files changed, 11 insertions(+), 444 deletions(-) delete mode 100644 .github/workflows/unit_race.yml rename .github/workflows/{unit_test_mysql57.yml => unit_test.yml} (91%) delete mode 100644 .github/workflows/unit_test_mysql80.yml delete mode 100644 .github/workflows/unit_test_mysql84.yml diff --git a/.github/workflows/unit_race.yml b/.github/workflows/unit_race.yml deleted file mode 100644 index 19cb744ae3a..00000000000 --- a/.github/workflows/unit_race.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: unit_race -on: - push: - branches: - - "main" - - "release-[0-9]+.[0-9]" - tags: '**' - pull_request: - branches: '**' -concurrency: - group: format('{0}-{1}', ${{ github.ref }}, 'unit_race') - 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: Unit Test (Race) - runs-on: oracle-vm-16cpu-64gb-x86-64 - steps: - - 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: 'false' - - - name: Check for changes in relevant files - uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1 - id: changes - with: - token: '' - filters: | - unit_tests: - - 'test/config.json' - - 'go/**' - - 'test.go' - - 'Makefile' - - 'build.env' - - 'go.sum' - - 'go.mod' - - 'proto/*.proto' - - 'tools/**' - - 'config/**' - - 'bootstrap.sh' - - '.github/workflows/unit_race.yml' - - - name: Set up Go - if: steps.changes.outputs.unit_tests == 'true' - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 - with: - go-version-file: go.mod - - - name: Set up python - if: steps.changes.outputs.unit_tests == 'true' - uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 - - - name: Tune the OS - if: steps.changes.outputs.unit_tests == 'true' - uses: ./.github/actions/tune-os - - - name: Setup MySQL - if: steps.changes.outputs.unit_tests == 'true' - uses: ./.github/actions/setup-mysql - with: - flavor: mysql-8.0 - - - name: Get dependencies - if: steps.changes.outputs.unit_tests == 'true' - run: | - export DEBIAN_FRONTEND="noninteractive" - sudo apt-get -qq update - - sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk - - mkdir -p dist bin - curl -s -L https://github.com/coreos/etcd/releases/download/v3.5.17/etcd-v3.5.17-linux-amd64.tar.gz | tar -zxC dist - mv dist/etcd-v3.5.17-linux-amd64/{etcd,etcdctl} bin/ - - go mod download - go install golang.org/x/tools/cmd/goimports@latest - - # install JUnit report formatter - go install github.com/vitessio/go-junit-report@HEAD - - - name: Run make tools - if: steps.changes.outputs.unit_tests == 'true' - run: | - make tools - - - name: Setup launchable dependencies - if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.unit_tests == '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: unit_race - if: steps.changes.outputs.unit_tests == '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/" - export NOVTADMINBUILD=1 - export VTEVALENGINETEST="0" - - make unit_test_race | tee -a output.txt | go-junit-report -set-exit-code > report.xml - - - 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.unit_tests == '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.unit_tests == 'true' && !cancelled() - run: | - # print test output - cat output.txt - - - name: Test Summary - if: steps.changes.outputs.unit_tests == 'true' && !cancelled() - uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 - with: - paths: "report.xml" - show: "fail" diff --git a/.github/workflows/unit_test_mysql57.yml b/.github/workflows/unit_test.yml similarity index 91% rename from .github/workflows/unit_test_mysql57.yml rename to .github/workflows/unit_test.yml index 0fe3f2ed1e7..8a7ab08a33f 100644 --- a/.github/workflows/unit_test_mysql57.yml +++ b/.github/workflows/unit_test.yml @@ -22,7 +22,15 @@ env: jobs: test: - name: Unit Test (mysql57) + strategy: + matrix: + flavor: [mysql57, mysql80, mysql84] + race: false + include: + - flavor: mysql80 + race: true + + name: Unit Test (${{ if matrix.race }}${{ matrix.flavor }}Race${{ else }}${{ matrix.flavor }}${{ endif }}) runs-on: ubuntu-24.04 steps: @@ -125,9 +133,9 @@ jobs: export VTEVALENGINETEST="0" # We sometimes need to alter the behavior based on the platform we're # testing, e.g. MySQL 5.7 vs 8.0. - export CI_DB_PLATFORM="mysql57" + export CI_DB_PLATFORM="${{ matrix.flavor }}" - make unit_test | tee -a output.txt | go-junit-report -set-exit-code > report.xml + make unit_test${{ if matrix.race }}_race{{ end }} | tee -a output.txt | go-junit-report -set-exit-code > report.xml - 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.unit_tests == 'true' && github.base_ref == 'main' && !cancelled() diff --git a/.github/workflows/unit_test_mysql80.yml b/.github/workflows/unit_test_mysql80.yml deleted file mode 100644 index 00eadf05ce8..00000000000 --- a/.github/workflows/unit_test_mysql80.yml +++ /dev/null @@ -1,149 +0,0 @@ -# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" - -name: Unit Test (mysql80) -on: - push: - branches: - - "main" - - "release-[0-9]+.[0-9]" - tags: '**' - pull_request: - branches: '**' -concurrency: - group: format('{0}-{1}', ${{ github.ref }}, 'Unit Test (mysql80)') - 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: - test: - name: Unit Test (mysql80) - runs-on: ubuntu-24.04 - - steps: - - 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: 'false' - - - name: Check for changes in relevant files - uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1 - id: changes - with: - token: '' - filters: | - unit_tests: - - 'test/config.json' - - 'go/**' - - 'test.go' - - 'Makefile' - - 'build.env' - - 'go.sum' - - 'go.mod' - - 'proto/*.proto' - - 'tools/**' - - 'config/**' - - 'bootstrap.sh' - - '.github/workflows/unit_test_mysql80.yml' - - - name: Set up Go - if: steps.changes.outputs.unit_tests == 'true' - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 - with: - go-version-file: go.mod - - - name: Set up python - if: steps.changes.outputs.unit_tests == 'true' - uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 - - - name: Tune the OS - if: steps.changes.outputs.unit_tests == 'true' - uses: ./.github/actions/tune-os - - - name: Setup MySQL - if: steps.changes.outputs.unit_tests == 'true' - uses: ./.github/actions/setup-mysql - with: - flavor: mysql-8.0 - - - name: Get dependencies - if: steps.changes.outputs.unit_tests == 'true' - run: | - export DEBIAN_FRONTEND="noninteractive" - sudo apt-get install -y make unzip g++ curl git wget ant openjdk-11-jdk - - mkdir -p dist bin - curl -s -L https://github.com/coreos/etcd/releases/download/v3.5.17/etcd-v3.5.17-linux-amd64.tar.gz | tar -zxC dist - mv dist/etcd-v3.5.17-linux-amd64/{etcd,etcdctl} bin/ - - go mod download - go install golang.org/x/tools/cmd/goimports@latest - - # install JUnit report formatter - go install github.com/vitessio/go-junit-report@HEAD - - - name: Run make tools - if: steps.changes.outputs.unit_tests == 'true' - run: | - make tools - - - name: Setup launchable dependencies - if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.unit_tests == '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 test - if: steps.changes.outputs.unit_tests == 'true' - timeout-minutes: 30 - run: | - set -exo pipefail - # 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/" - - export NOVTADMINBUILD=1 - export VT_GO_PARALLEL_VALUE=$(nproc) - export VTEVALENGINETEST="0" - # We sometimes need to alter the behavior based on the platform we're - # testing, e.g. MySQL 5.7 vs 8.0. - export CI_DB_PLATFORM="mysql80" - - make unit_test | tee -a output.txt | go-junit-report -set-exit-code > report.xml - - - 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.unit_tests == '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.unit_tests == 'true' && !cancelled() - run: | - # print test output - cat output.txt - - - name: Test Summary - if: steps.changes.outputs.unit_tests == 'true' && !cancelled() - uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 - with: - paths: "report.xml" - show: "fail" diff --git a/.github/workflows/unit_test_mysql84.yml b/.github/workflows/unit_test_mysql84.yml deleted file mode 100644 index f8407039c46..00000000000 --- a/.github/workflows/unit_test_mysql84.yml +++ /dev/null @@ -1,149 +0,0 @@ -# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" - -name: Unit Test (mysql84) -on: - push: - branches: - - "main" - - "release-[0-9]+.[0-9]" - tags: '**' - pull_request: - branches: '**' -concurrency: - group: format('{0}-{1}', ${{ github.ref }}, 'Unit Test (mysql84)') - 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: - test: - name: Unit Test (mysql84) - runs-on: ubuntu-24.04 - - steps: - - 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: 'false' - - - name: Check for changes in relevant files - uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1 - id: changes - with: - token: '' - filters: | - unit_tests: - - 'test/config.json' - - 'go/**' - - 'test.go' - - 'Makefile' - - 'build.env' - - 'go.sum' - - 'go.mod' - - 'proto/*.proto' - - 'tools/**' - - 'config/**' - - 'bootstrap.sh' - - '.github/workflows/unit_test_mysql84.yml' - - - name: Set up Go - if: steps.changes.outputs.unit_tests == 'true' - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 - with: - go-version-file: go.mod - - - name: Set up python - if: steps.changes.outputs.unit_tests == 'true' - uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 - - - name: Tune the OS - if: steps.changes.outputs.unit_tests == 'true' - uses: ./.github/actions/tune-os - - - name: Setup MySQL - if: steps.changes.outputs.unit_tests == 'true' - uses: ./.github/actions/setup-mysql - with: - flavor: mysql-8.4 - - - name: Get dependencies - if: steps.changes.outputs.unit_tests == 'true' - run: | - export DEBIAN_FRONTEND="noninteractive" - sudo apt-get install -y make unzip g++ curl git wget ant openjdk-11-jdk - - mkdir -p dist bin - curl -s -L https://github.com/coreos/etcd/releases/download/v3.5.17/etcd-v3.5.17-linux-amd64.tar.gz | tar -zxC dist - mv dist/etcd-v3.5.17-linux-amd64/{etcd,etcdctl} bin/ - - go mod download - go install golang.org/x/tools/cmd/goimports@latest - - # install JUnit report formatter - go install github.com/vitessio/go-junit-report@HEAD - - - name: Run make tools - if: steps.changes.outputs.unit_tests == 'true' - run: | - make tools - - - name: Setup launchable dependencies - if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.unit_tests == '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 test - if: steps.changes.outputs.unit_tests == 'true' - timeout-minutes: 30 - run: | - set -exo pipefail - # 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/" - - export NOVTADMINBUILD=1 - export VT_GO_PARALLEL_VALUE=$(nproc) - export VTEVALENGINETEST="0" - # We sometimes need to alter the behavior based on the platform we're - # testing, e.g. MySQL 5.7 vs 8.0. - export CI_DB_PLATFORM="mysql84" - - make unit_test | tee -a output.txt | go-junit-report -set-exit-code > report.xml - - - 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.unit_tests == '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.unit_tests == 'true' && !cancelled() - run: | - # print test output - cat output.txt - - - name: Test Summary - if: steps.changes.outputs.unit_tests == 'true' && !cancelled() - uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 - with: - paths: "report.xml" - show: "fail" From 428ff43a1388d17f2e8e33715cd5b571c89e0fb5 Mon Sep 17 00:00:00 2001 From: Arthur Schreiber Date: Thu, 30 Oct 2025 17:07:01 +0000 Subject: [PATCH 2/5] Fix the workflow. Signed-off-by: Arthur Schreiber --- .github/workflows/unit_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 8a7ab08a33f..861c8ff017d 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -30,7 +30,7 @@ jobs: - flavor: mysql80 race: true - name: Unit Test (${{ if matrix.race }}${{ matrix.flavor }}Race${{ else }}${{ matrix.flavor }}${{ endif }}) + name: Unit Test (${{ (matrix.race && 'Race') || matrix.flavor }}) runs-on: ubuntu-24.04 steps: @@ -135,7 +135,7 @@ jobs: # testing, e.g. MySQL 5.7 vs 8.0. export CI_DB_PLATFORM="${{ matrix.flavor }}" - make unit_test${{ if matrix.race }}_race{{ end }} | tee -a output.txt | go-junit-report -set-exit-code > report.xml + make unit_test${{ matrix.race && '_race' }} | tee -a output.txt | go-junit-report -set-exit-code > report.xml - 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.unit_tests == 'true' && github.base_ref == 'main' && !cancelled() From b9688a07660b6e3ddbf15c8ab923a610a4ce9753 Mon Sep 17 00:00:00 2001 From: Arthur Schreiber Date: Thu, 30 Oct 2025 17:08:32 +0000 Subject: [PATCH 3/5] Fix this too. Signed-off-by: Arthur Schreiber --- .github/workflows/unit_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 861c8ff017d..495428aec64 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: flavor: [mysql57, mysql80, mysql84] - race: false + race: [false] include: - flavor: mysql80 race: true From d5a232407fa2beca166725cb8bd6a7d447ce8d70 Mon Sep 17 00:00:00 2001 From: Arthur Schreiber Date: Thu, 30 Oct 2025 17:12:50 +0000 Subject: [PATCH 4/5] Fix this. Signed-off-by: Arthur Schreiber --- .github/workflows/unit_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 495428aec64..655a25158cc 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -135,7 +135,7 @@ jobs: # testing, e.g. MySQL 5.7 vs 8.0. export CI_DB_PLATFORM="${{ matrix.flavor }}" - make unit_test${{ matrix.race && '_race' }} | tee -a output.txt | go-junit-report -set-exit-code > report.xml + make unit_test${{ (matrix.race && '_race') || '' }} | tee -a output.txt | go-junit-report -set-exit-code > report.xml - 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.unit_tests == 'true' && github.base_ref == 'main' && !cancelled() From b9372ad3d86cee7d4eafb56e3619edfc40790fa4 Mon Sep 17 00:00:00 2001 From: Arthur Schreiber Date: Fri, 31 Oct 2025 10:52:18 +0000 Subject: [PATCH 5/5] Do not fail fast on matrix workflows. Signed-off-by: Arthur Schreiber --- .github/workflows/unit_test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 655a25158cc..1c7f639c53a 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -1,6 +1,6 @@ # DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" -name: Unit Test (mysql57) +name: Unit Tests on: push: branches: @@ -10,7 +10,7 @@ on: pull_request: branches: '**' concurrency: - group: format('{0}-{1}', ${{ github.ref }}, 'Unit Test (mysql57)') + group: format('{0}-{1}', ${{ github.ref }}, 'Unit Tests') cancel-in-progress: true permissions: read-all @@ -23,9 +23,11 @@ env: jobs: test: strategy: + fail-fast: false matrix: flavor: [mysql57, mysql80, mysql84] race: [false] + include: - flavor: mysql80 race: true