Skip to content

Commit 756f3d3

Browse files
committed
add error detection for test setup, sort tests to make it easier to track progress
1 parent 7cebc16 commit 756f3d3

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

localtests/test.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,15 @@ test_single() {
116116
gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "set @@global.sql_mode='$(cat $tests_path/$test_name/sql_mode)'"
117117
fi
118118

119-
cat $tests_path/$test_name/create.sql
120-
bash -x gh-ost-test-mysql-master --default-character-set=utf8mb4 test < $tests_path/$test_name/create.sql
121-
echo $?
119+
gh-ost-test-mysql-master --default-character-set=utf8mb4 test < $tests_path/$test_name/create.sql
120+
test_create_result=$?
121+
122+
if [ $test_create_result -ne 0 ] ; then
123+
echo
124+
echo "ERROR $test_name create failure. cat $tests_path/$test_name/create.sql:"
125+
cat $tests_path/$test_name/create.sql
126+
return 1
127+
fi
122128

123129
extra_args=""
124130
if [ -f $tests_path/$test_name/extra_args ] ; then
@@ -257,7 +263,7 @@ build_binary() {
257263

258264
test_all() {
259265
build_binary
260-
find $tests_path ! -path . -type d -mindepth 1 -maxdepth 1 | cut -d "/" -f 3 | egrep "$test_pattern" | while read test_name ; do
266+
find $tests_path ! -path . -type d -mindepth 1 -maxdepth 1 | cut -d "/" -f 3 | egrep "$test_pattern" | sort | while read test_name ; do
261267
test_single "$test_name"
262268
if [ $? -ne 0 ] ; then
263269
create_statement=$(gh-ost-test-mysql-replica test -t -e "show create table _gh_ost_test_gho \G")

script/cibuild-gh-ost-replica-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ test_mysql_version() {
6161
gh-ost-test-mysql-master -uroot -e "grant all on *.* to 'gh-ost'@'%'"
6262

6363
echo "### Running gh-ost tests for $mysql_version"
64-
bash -x ./localtests/test.sh -b bin/gh-ost
64+
./localtests/test.sh -b bin/gh-ost
6565

6666
find sandboxes -name "stop_all" | bash
6767
}

0 commit comments

Comments
 (0)