Skip to content

Commit 4a07598

Browse files
committed
CI: test against TiDB
1 parent b085ac7 commit 4a07598

File tree

8 files changed

+82
-0
lines changed

8 files changed

+82
-0
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,39 @@ jobs:
120120
make
121121
- name: "Run test"
122122
run: make test
123+
124+
test-tidb:
125+
runs-on: 'ubuntu-latest'
126+
services:
127+
mariadb:
128+
image: 'pingcap/tidb:latest'
129+
ports:
130+
- 4000:4000
131+
steps:
132+
- uses: actions/checkout@v4
133+
- name: "Setup generic dependencies"
134+
run: |
135+
sudo apt update
136+
sudo apt install -y \
137+
gcc \
138+
gnupg \
139+
libdbi-perl \
140+
libdevel-checklib-perl \
141+
libtest-deep-perl \
142+
libtest-pod-perl \
143+
lsb-release \
144+
make \
145+
wget
146+
sudo debconf-set-selections <<EOF
147+
mysql-apt-config mysql-apt-config/select-server select mysql-8.4-lts
148+
EOF
149+
wget https://dev.mysql.com/get/mysql-apt-config_0.8.33-1_all.deb
150+
DEBIAN_FRONTEND="noninteractive" sudo dpkg -i mysql-apt-config_0.8.33-1_all.deb
151+
sudo apt update
152+
sudo apt install -y libmysqlclient-dev
153+
- name: "Run build"
154+
run: |
155+
perl Makefile.PL --testhost=127.0.0.1 --testuser=root --testport=4000
156+
make
157+
- name: "Run test"
158+
run: make test

t/51bind_type_guessing.t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ if ($dbh->{'mysql_serverinfo'} =~ 'MariaDB') {
2222
plan skip_all => "This test isn't made to work with MariaDB yet";
2323
}
2424

25+
# Tested with TiDB v8.5.1.
26+
# https://github.com/pingcap/tidb/issues/60671
27+
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
28+
plan skip_all =>
29+
"SKIP TEST: test disabled on TiDB";
30+
}
31+
2532
plan tests => 98;
2633

2734
ok $dbh->do("DROP TABLE IF EXISTS dbd_mysql_t51bind_type_guessing"),

t/55utf8.t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ if ($dbh->{mysql_serverversion} < 50000) {
2222
plan skip_all =>
2323
"SKIP TEST: You must have MySQL version 5.0 and greater for this test to run";
2424
}
25+
26+
# Tested with TiDB v8.5.1.
27+
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
28+
plan skip_all =>
29+
"SKIP TEST: TiDB doesn't support GEOMETRY data type";
30+
}
31+
2532
plan tests => 16 * 2;
2633

2734
for my $mysql_server_prepare (0, 1) {

t/55utf8_errors.t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ eval {
2121
if ($@) {
2222
plan skip_all => "no database connection";
2323
}
24+
25+
# Tested with TiDB v8.5.1.
26+
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
27+
plan skip_all =>
28+
"SKIP TEST: lc_messages not supported on TiDB";
29+
}
30+
2431
$dbh->disconnect();
2532

2633
plan tests => 10 * 3;

t/80procs.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ if ($dbh->{mysql_serverversion} < 50000) {
2525
"You must have MySQL version 5.0 and greater for this test to run";
2626
}
2727

28+
# Tested with TiDB v8.5.1.
29+
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
30+
plan skip_all =>
31+
"SKIP TEST: TiDB doesn't support stored procedures";
32+
}
33+
2834
if (!CheckRoutinePerms($dbh)) {
2935
plan skip_all =>
3036
"Your test user does not have ALTER_ROUTINE privileges.";

t/81procs.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ if ($dbh->{mysql_serverversion} < 50000) {
2525
"You must have MySQL version 5.0 and greater for this test to run";
2626
}
2727

28+
# Tested with TiDB v8.5.1.
29+
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
30+
plan skip_all =>
31+
"SKIP TEST: TiDB doesn't support stored procedures";
32+
}
33+
2834
if (!CheckRoutinePerms($dbh)) {
2935
plan skip_all =>
3036
"Your test user does not have ALTER_ROUTINE privileges.";

t/rt118977-zerofill.t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ require "t/lib.pl";
1010
my $dbh = eval { DBI->connect($test_dsn, $test_user, $test_password, { PrintError => 1, RaiseError => 1 }) };
1111
plan skip_all => "no database connection" if $@ or not $dbh;
1212

13+
# Tested with TiDB v8.5.1.
14+
if ($dbh->{'mysql_serverinfo'} =~ 'TiDB') {
15+
plan skip_all =>
16+
# https://docs.pingcap.com/tidb/stable/mysql-compatibility/#incompatibility-due-to-deprecated-features
17+
"SKIP TEST: TiDB doesn't support ZEROFILL";
18+
}
19+
1320
plan tests => 4*2;
1421

1522
for my $mysql_server_prepare (0, 1) {

t/rt75353-innodb-lock-timeout.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ require "t/lib.pl";
1010
my $dbh1 = eval { DBI->connect($test_dsn, $test_user, $test_password, { RaiseError => 1, AutoCommit => 0 }) };
1111
plan skip_all => "no database connection" if $@ or not $dbh1;
1212

13+
if ($dbh1->{'mysql_serverinfo'} =~ 'TiDB') {
14+
plan skip_all =>
15+
# https://docs.pingcap.com/tidb/stable/pessimistic-transaction/#difference-with-mysql-innodb
16+
"SKIP TEST: locking behavior on TiDB is different";
17+
}
18+
1319
my $dbh2 = eval { DBI->connect($test_dsn, $test_user, $test_password, { RaiseError => 1, AutoCommit => 0 }) };
1420
plan skip_all => "no database connection" if $@ or not $dbh2;
1521

0 commit comments

Comments
 (0)