vitess.io/vitess@v0.16.2/test/templates/cluster_endtoend_test_mysql57.tpl (about) 1 name: {{.Name}} 2 on: [push, pull_request] 3 concurrency: 4 group: format('{0}-{1}', ${{"{{"}} github.ref {{"}}"}}, '{{.Name}}') 5 cancel-in-progress: true 6 7 env: 8 LAUNCHABLE_ORGANIZATION: "vitess" 9 LAUNCHABLE_WORKSPACE: "vitess-app" 10 GITHUB_PR_HEAD_SHA: "${{`{{ github.event.pull_request.head.sha }}`}}" 11 {{if .InstallXtraBackup}} 12 # This is used if we need to pin the xtrabackup version used in tests. 13 # If this is NOT set then the latest version available will be used. 14 #XTRABACKUP_VERSION: "2.4.24-1" 15 {{end}} 16 17 jobs: 18 build: 19 name: Run endtoend tests on {{.Name}} 20 runs-on: ubuntu-22.04 21 22 steps: 23 - name: Skip CI 24 run: | 25 if [[ "{{"${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}"}}" == "true" ]]; then 26 echo "skipping CI due to the 'Skip CI' label" 27 exit 1 28 fi 29 30 - name: Check if workflow needs to be skipped 31 id: skip-workflow 32 run: | 33 skip='false' 34 if [[ "{{"${{github.event.pull_request}}"}}" == "" ]] && [[ "{{"${{github.ref}}"}}" != "refs/heads/main" ]] && [[ ! "{{"${{github.ref}}"}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "{{"${{github.ref}}"}}" =~ "refs/tags/.*" ]]; then 35 skip='true' 36 fi 37 echo Skip ${skip} 38 echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT 39 40 - name: Check out code 41 if: steps.skip-workflow.outputs.skip-workflow == 'false' 42 uses: actions/checkout@v3 43 44 - name: Check for changes in relevant files 45 if: steps.skip-workflow.outputs.skip-workflow == 'false' 46 uses: frouioui/paths-filter@main 47 id: changes 48 with: 49 token: '' 50 filters: | 51 end_to_end: 52 - 'go/**/*.go' 53 - 'test.go' 54 - 'Makefile' 55 - 'build.env' 56 - 'go.sum' 57 - 'go.mod' 58 - 'proto/*.proto' 59 - 'tools/**' 60 - 'config/**' 61 - 'bootstrap.sh' 62 - '.github/workflows/{{.FileName}}' 63 {{- if or (contains .Name "onlineddl") (contains .Name "schemadiff") }} 64 - 'go/test/endtoend/onlineddl/vrepl_suite/testdata' 65 {{- end}} 66 67 - name: Set up Go 68 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 69 uses: actions/setup-go@v3 70 with: 71 go-version: 1.20.3 72 73 - name: Set up python 74 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 75 uses: actions/setup-python@v4 76 77 - name: Tune the OS 78 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 79 run: | 80 sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535" 81 # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio 82 echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf 83 sudo sysctl -p /etc/sysctl.conf 84 85 - name: Get dependencies 86 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 87 run: | 88 sudo apt-get update 89 90 # Uninstall any previously installed MySQL first 91 sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ 92 sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld 93 94 sudo systemctl stop apparmor 95 sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common 96 sudo apt-get -y autoremove 97 sudo apt-get -y autoclean 98 sudo deluser mysql 99 sudo rm -rf /var/lib/mysql 100 sudo rm -rf /etc/mysql 101 102 # Get key to latest MySQL repo 103 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 104 105 wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb 106 # Bionic packages are still compatible for Jammy since there's no MySQL 5.7 107 # packages for Jammy. 108 echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections 109 echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections 110 sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* 111 sudo apt-get update 112 sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 113 114 sudo apt-get install -y make unzip g++ etcd curl git wget eatmydata 115 sudo service mysql stop 116 sudo service etcd stop 117 118 # install JUnit report formatter 119 go install github.com/vitessio/go-junit-report@HEAD 120 121 {{if .InstallXtraBackup}} 122 123 wget "https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb" 124 sudo apt-get install -y gnupg2 125 sudo dpkg -i "percona-release_latest.$(lsb_release -sc)_all.deb" 126 sudo apt-get update 127 if [[ -n $XTRABACKUP_VERSION ]]; then 128 debfile="percona-xtrabackup-24_$XTRABACKUP_VERSION.$(lsb_release -sc)_amd64.deb" 129 wget "https://repo.percona.com/pxb-24/apt/pool/main/p/percona-xtrabackup-24/$debfile" 130 sudo apt install -y "./$debfile" 131 else 132 sudo apt-get install -y percona-xtrabackup-24 133 fi 134 135 {{end}} 136 137 {{if .MakeTools}} 138 139 - name: Installing zookeeper and consul 140 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 141 run: | 142 make tools 143 144 {{end}} 145 146 - name: Setup launchable dependencies 147 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' 148 run: | 149 # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up 150 pip3 install --user launchable~=1.0 > /dev/null 151 152 # verify that launchable setup is all correct. 153 launchable verify || true 154 155 # Tell Launchable about the build you are producing and testing 156 launchable record build --name "$GITHUB_RUN_ID" --source . 157 158 - name: Run cluster endtoend test 159 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' 160 timeout-minutes: 45 161 run: | 162 # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file 163 # which musn't be more than 107 characters long. 164 export VTDATAROOT="/tmp/" 165 source build.env 166 167 set -x 168 169 {{if .LimitResourceUsage}} 170 # Increase our local ephemeral port range as we could exhaust this 171 sudo sysctl -w net.ipv4.ip_local_port_range="22768 61999" 172 # Increase our open file descriptor limit as we could hit this 173 ulimit -n 65536 174 cat <<-EOF>>./config/mycnf/mysql57.cnf 175 innodb_buffer_pool_dump_at_shutdown=OFF 176 innodb_buffer_pool_load_at_startup=OFF 177 innodb_buffer_pool_size=64M 178 innodb_doublewrite=OFF 179 innodb_flush_log_at_trx_commit=0 180 innodb_flush_method=O_DIRECT 181 innodb_numa_interleave=ON 182 innodb_adaptive_hash_index=OFF 183 sync_binlog=0 184 sync_relay_log=0 185 performance_schema=OFF 186 slow-query-log=OFF 187 EOF 188 {{end}} 189 190 # run the tests however you normally do, then produce a JUnit XML file 191 eatmydata -- go run test.go -docker={{if .Docker}}true -flavor={{.Platform}}{{else}}false{{end}} -follow -shard {{.Shard}}{{if .PartialKeyspace}} -partial-keyspace=true {{end}} | tee -a output.txt | go-junit-report -set-exit-code > report.xml 192 193 - name: Print test output and Record test result in launchable 194 if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() 195 run: | 196 # send recorded tests to launchable 197 launchable record tests --build "$GITHUB_RUN_ID" go-test . || true 198 199 # print test output 200 cat output.txt