Skip to content

Commit 0adf258

Browse files
author
Shlomi Noach
committed
added charset tests
1 parent 7a4ae01 commit 0adf258

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

localtests/test.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ tests_path=$(dirname $0)
88
test_logfile=/tmp/gh-ost-test.log
99
exec_command_file=/tmp/gh-ost-test.bash
1010

11+
test_pattern="${1:-.}"
12+
1113
master_host=
1214
master_port=
1315
replica_host=
@@ -32,13 +34,19 @@ exec_cmd() {
3234
return $?
3335
}
3436

37+
echo_dot() {
38+
echo -n "."
39+
}
40+
3541
test_single() {
3642
local test_name
3743
test_name="$1"
3844

39-
echo "Testing: $test_name"
45+
echo -n "Testing: $test_name"
4046

47+
echo_dot
4148
gh-ost-test-mysql-replica -e "start slave"
49+
echo_dot
4250
gh-ost-test-mysql-master test < $tests_path/$test_name/create.sql
4351

4452
extra_args=""
@@ -50,6 +58,7 @@ test_single() {
5058
columns=$(cat $tests_path/$test_name/test_columns)
5159
fi
5260
# graceful sleep for replica to catch up
61+
echo_dot
5362
sleep 1
5463
#
5564
cmd="go run go/cmd/gh-ost/main.go \
@@ -74,14 +83,18 @@ test_single() {
7483
--debug \
7584
--stack \
7685
--execute ${extra_args[@]}"
86+
echo_dot
7787
echo $cmd > $exec_command_file
88+
echo_dot
7889
bash $exec_command_file 1> $test_logfile 2>&1
7990

8091
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"
8294
return 1
8395
fi
8496

97+
echo_dot
8598
orig_checksum=$(gh-ost-test-mysql-replica test -e "select ${columns} from gh_ost_test" -ss | md5sum)
8699
ghost_checksum=$(gh-ost-test-mysql-replica test -e "select ${columns} from _gh_ost_test_gho" -ss | md5sum)
87100

@@ -96,7 +109,7 @@ test_single() {
96109
}
97110

98111
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
100113
test_single "$test_name"
101114
if [ $? -ne 0 ] ; then
102115
echo "+ FAIL"

0 commit comments

Comments
 (0)