forked from radondb/radon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add integration test radondb#594
[summary] ci: support intergration test [test case] N/A [patch codecov] N/A
- Loading branch information
Showing
6 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
TEST_FILE_PATH="./t/" | ||
RESULT_FILE_PATH="./r/" | ||
SUFFIX=".result" | ||
|
||
cd $TEST_FILE_PATH | ||
for FILE in `ls *.test` | ||
do | ||
echo "testing "$FILE | ||
basename=`basename $FILE .test` | ||
tmpFile="tmp_"$basename$SUFFIX | ||
resultFile="../r/"$basename$SUFFIX | ||
|
||
string=`cat $FILE | tr -s '\r'` | ||
|
||
#split by ";" | ||
IFS=";" | ||
split=";" | ||
for sqlWithoutSemi in ${string[@]} | ||
do | ||
if [ "$sqlWithoutSemi" ] | ||
then | ||
# record every sql executed to tmp file | ||
echo $sqlWithoutSemi";" >> $tmpFile | ||
# execute and record result to tmp file | ||
mysql -uroot -P3308 -h127.0.0.1 -e "$sqlWithoutSemi" >> $tmpFile | ||
else | ||
echo "empty sql, skip and continue" | ||
fi | ||
done | ||
diff $tmpFile $resultFile | ||
|
||
if [ $? -ne 0 ] | ||
then | ||
# FAIL | ||
echo "testing "$FILE" FAIL" | ||
exit 1 | ||
else | ||
# SUCCESS | ||
echo "testing "$FILE" SUCCESS" | ||
rm -f $tmpFile | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
create database integrate_test DEFAULT CHARSET=utf8; | ||
|
||
|
||
create table integrate_test.t( | ||
a int key, | ||
b int) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
show create table integrate_test.t; | ||
Table Create Table | ||
t CREATE TABLE `t` (\n `a` int(11) NOT NULL,\n `b` int(11) DEFAULT NULL,\n PRIMARY KEY (`a`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8\n/*!50100 PARTITION BY HASH(a) */ | ||
|
||
drop table integrate_test.t; | ||
|
||
|
||
create table integrate_test.t( | ||
a int, | ||
b int, | ||
c char(10), | ||
primary key(a, b)) PARTITION BY HASH(a) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
show create table integrate_test.t; | ||
Table Create Table | ||
t CREATE TABLE `t` (\n `a` int(11) NOT NULL,\n `b` int(11) NOT NULL,\n `c` char(10) DEFAULT NULL,\n PRIMARY KEY (`a`,`b`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8\n/*!50100 PARTITION BY HASH(a) */ | ||
|
||
drop table integrate_test.t; | ||
|
||
|
||
drop database integrate_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
create database integrate_test DEFAULT CHARSET=utf8; | ||
|
||
|
||
create table integrate_test.t(a int key, b int) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
insert into integrate_test.t(a, b) values(0,1), (2,3); | ||
|
||
select a, b c from integrate_test.t where a in (0,1,2) order by a desc; | ||
a c | ||
2 3 | ||
0 1 | ||
|
||
drop table integrate_test.t; | ||
|
||
|
||
drop database integrate_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
create database integrate_test DEFAULT CHARSET=utf8; | ||
|
||
create table integrate_test.t( | ||
a int key, | ||
b int) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
show create table integrate_test.t; | ||
drop table integrate_test.t; | ||
|
||
create table integrate_test.t( | ||
a int, | ||
b int, | ||
c char(10), | ||
primary key(a, b)) PARTITION BY HASH(a) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
show create table integrate_test.t; | ||
drop table integrate_test.t; | ||
|
||
drop database integrate_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
create database integrate_test DEFAULT CHARSET=utf8; | ||
|
||
create table integrate_test.t(a int key, b int) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
insert into integrate_test.t(a, b) values(0,1), (2,3); | ||
select a, b c from integrate_test.t where a in (0,1,2) order by a desc; | ||
drop table integrate_test.t; | ||
|
||
drop database integrate_test; |