@@ -8,6 +8,8 @@ tests_path=$(dirname $0)
8
8
test_logfile=/tmp/gh-ost-test.log
9
9
exec_command_file=/tmp/gh-ost-test.bash
10
10
11
+ test_pattern=" ${1:- .} "
12
+
11
13
master_host=
12
14
master_port=
13
15
replica_host=
@@ -32,13 +34,19 @@ exec_cmd() {
32
34
return $?
33
35
}
34
36
37
+ echo_dot () {
38
+ echo -n " ."
39
+ }
40
+
35
41
test_single () {
36
42
local test_name
37
43
test_name=" $1 "
38
44
39
- echo " Testing: $test_name "
45
+ echo -n " Testing: $test_name "
40
46
47
+ echo_dot
41
48
gh-ost-test-mysql-replica -e " start slave"
49
+ echo_dot
42
50
gh-ost-test-mysql-master test < $tests_path /$test_name /create.sql
43
51
44
52
extra_args=" "
@@ -50,6 +58,7 @@ test_single() {
50
58
columns=$( cat $tests_path /$test_name /test_columns)
51
59
fi
52
60
# graceful sleep for replica to catch up
61
+ echo_dot
53
62
sleep 1
54
63
#
55
64
cmd=" go run go/cmd/gh-ost/main.go \
@@ -74,14 +83,18 @@ test_single() {
74
83
--debug \
75
84
--stack \
76
85
--execute ${extra_args[@]} "
86
+ echo_dot
77
87
echo $cmd > $exec_command_file
88
+ echo_dot
78
89
bash $exec_command_file 1> $test_logfile 2>&1
79
90
80
91
if [ $? -ne 0 ] ; then
81
- echo " ERROR $test_name execution failure. See $test_logfile "
92
+ echo
93
+ echo " ERROR $test_name execution failure. cat $test_logfile "
82
94
return 1
83
95
fi
84
96
97
+ echo_dot
85
98
orig_checksum=$( gh-ost-test-mysql-replica test -e " select ${columns} from gh_ost_test" -ss | md5sum)
86
99
ghost_checksum=$( gh-ost-test-mysql-replica test -e " select ${columns} from _gh_ost_test_gho" -ss | md5sum)
87
100
@@ -96,7 +109,7 @@ test_single() {
96
109
}
97
110
98
111
test_all () {
99
- find $tests_path ! -path . -type d -mindepth 1 -maxdepth 1 | cut -d " /" -f 3 | while read test_name ; do
112
+ find $tests_path ! -path . -type d -mindepth 1 -maxdepth 1 | cut -d " /" -f 3 | egrep " $test_pattern " | while read test_name ; do
100
113
test_single " $test_name "
101
114
if [ $? -ne 0 ] ; then
102
115
echo " + FAIL"
0 commit comments