feat: Allow specifying the hex width to use when generating shard ranges. #11193
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: unit_race_evalengine | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| - "release-[0-9]+.[0-9]" | |
| tags: '**' | |
| pull_request: | |
| branches: '**' | |
| concurrency: | |
| group: format('{0}-{1}', ${{ github.ref }}, 'unit_race_evalengine') | |
| 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 (Evalengine_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_evalengine.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' | |
| run: | | |
| sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535" | |
| # Don't waste a bunch of time processing man-db triggers | |
| echo "set man-db/auto-update false" | sudo debconf-communicate | |
| sudo dpkg-reconfigure man-db | |
| - name: Get dependencies | |
| if: steps.changes.outputs.unit_tests == 'true' | |
| run: | | |
| export DEBIAN_FRONTEND="noninteractive" | |
| sudo apt-get -qq update | |
| # mysql80 | |
| sudo apt-get -qq install -y mysql-server mysql-client | |
| sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata | |
| sudo service mysql stop | |
| sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 | |
| sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ | |
| sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" | |
| 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_evalengine | |
| 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="1" | |
| eatmydata -- 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" |