-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathcommon_test.go
30 lines (24 loc) · 1.01 KB
/
common_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package client
import (
"flag"
"strings"
"testing"
. "github.com/pingcap/check"
"github.com/go-mysql-org/go-mysql/test_util"
)
var testUser = flag.String("user", "root", "MySQL user")
var testPassword = flag.String("pass", "", "MySQL password")
var testDB = flag.String("db", "test", "MySQL test database")
func Test(t *testing.T) {
// We cover the whole range of MySQL server versions using docker-compose to bind them to different ports for testing.
// MySQL is constantly updating auth plugin to make it secure:
// starting from MySQL 8.0.4, a new auth plugin is introduced, causing plain password auth to fail with error:
// ERROR 1251 (08004): Client does not support authentication protocol requested by server; consider upgrading MySQL client
// Hint: use docker-compose to start corresponding MySQL docker containers and add their ports here
segs := strings.Split(*test_util.MysqlPort, ",")
for _, seg := range segs {
Suite(&clientTestSuite{port: seg})
Suite(&connTestSuite{port: seg})
}
TestingT(t)
}