Skip to content

Commit dc97dfa

Browse files
authored
Merge pull request #789 from dveeden/test_80
tests: select testdb and use MySQL 8.0 by default
2 parents f14527e + bef614a commit dc97dfa

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
matrix:
88
go: [ "1.20", "1.19", "1.18" ]
99
os: [ ubuntu-22.04, ubuntu-20.04 ]
10-
name: Tests Go ${{ matrix.go }} # This name is used in main branch protection rules
10+
name: Tests Go ${{ matrix.go }} on ${{ matrix.os }} # This name is used in main branch protection rules
1111
runs-on: ${{ matrix.os }}
1212

1313
steps:
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
sudo apt-get install -y make gcc
3333
- name: Install Go
34-
uses: actions/setup-go@v2
34+
uses: actions/setup-go@v4
3535
with:
3636
go-version: ${{ matrix.go }}
3737
- name: Checkout code

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build:
1111
test:
1212
go test --race -timeout 2m ./...
1313

14-
MYSQL_VERSION ?= 5.7
14+
MYSQL_VERSION ?= 8.0
1515
test-local:
1616
docker run --rm -d --network=host --name go-mysql-server \
1717
-e MYSQL_ALLOW_EMPTY_PASSWORD=true \

client/conn_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ func (s *connTestSuite) TestExecuteMultiple() {
106106
`THIS IS BOGUS()`,
107107
}
108108

109+
_, err := s.c.Execute("USE " + *testDB)
110+
require.Nil(s.T(), err)
111+
109112
count := 0
110113
result, err := s.c.ExecuteMultiple(strings.Join(queries, "; "), func(result *mysql.Result, err error) {
111114
switch count {

docker/resources/waitfor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ port=$2
44

55
echo "Waiting for mysql at $host:$port"
66
while true; do
7-
docker run --rm -it --network=host mysql:5.7 mysql -h$host -P$port -e "SELECT RAND()" >/dev/null
7+
docker run --rm -it --network=host mysql:8.0 mysql -h$host -P$port -e "SELECT RAND()" >/dev/null
88
if [[ $? -eq 0 ]]; then
99
echo 'Connected'
1010
break

0 commit comments

Comments
 (0)