Skip to content

Commit

Permalink
Merge pull request go-mysql-org#789 from dveeden/test_80
Browse files Browse the repository at this point in the history
tests: select testdb and use MySQL 8.0 by default
  • Loading branch information
lance6716 authored Jul 1, 2023
2 parents f14527e + bef614a commit dc97dfa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
matrix:
go: [ "1.20", "1.19", "1.18" ]
os: [ ubuntu-22.04, ubuntu-20.04 ]
name: Tests Go ${{ matrix.go }} # This name is used in main branch protection rules
name: Tests Go ${{ matrix.go }} on ${{ matrix.os }} # This name is used in main branch protection rules
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -31,7 +31,7 @@ jobs:
run: |
sudo apt-get install -y make gcc
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build:
test:
go test --race -timeout 2m ./...

MYSQL_VERSION ?= 5.7
MYSQL_VERSION ?= 8.0
test-local:
docker run --rm -d --network=host --name go-mysql-server \
-e MYSQL_ALLOW_EMPTY_PASSWORD=true \
Expand Down
3 changes: 3 additions & 0 deletions client/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ func (s *connTestSuite) TestExecuteMultiple() {
`THIS IS BOGUS()`,
}

_, err := s.c.Execute("USE " + *testDB)
require.Nil(s.T(), err)

count := 0
result, err := s.c.ExecuteMultiple(strings.Join(queries, "; "), func(result *mysql.Result, err error) {
switch count {
Expand Down
2 changes: 1 addition & 1 deletion docker/resources/waitfor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ port=$2

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

0 comments on commit dc97dfa

Please sign in to comment.