add error detection for test setup, sort tests to make it easier to track progress

This commit is contained in:
dm-2 2022-11-18 15:44:14 +00:00
parent 7cebc16c6f
commit 756f3d30e8
2 changed files with 11 additions and 5 deletions

View File

@ -116,9 +116,15 @@ test_single() {
gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "set @@global.sql_mode='$(cat $tests_path/$test_name/sql_mode)'"
fi
cat $tests_path/$test_name/create.sql
bash -x gh-ost-test-mysql-master --default-character-set=utf8mb4 test < $tests_path/$test_name/create.sql
echo $?
gh-ost-test-mysql-master --default-character-set=utf8mb4 test < $tests_path/$test_name/create.sql
test_create_result=$?
if [ $test_create_result -ne 0 ] ; then
echo
echo "ERROR $test_name create failure. cat $tests_path/$test_name/create.sql:"
cat $tests_path/$test_name/create.sql
return 1
fi
extra_args=""
if [ -f $tests_path/$test_name/extra_args ] ; then
@ -257,7 +263,7 @@ build_binary() {
test_all() {
build_binary
find $tests_path ! -path . -type d -mindepth 1 -maxdepth 1 | cut -d "/" -f 3 | egrep "$test_pattern" | while read test_name ; do
find $tests_path ! -path . -type d -mindepth 1 -maxdepth 1 | cut -d "/" -f 3 | egrep "$test_pattern" | sort | while read test_name ; do
test_single "$test_name"
if [ $? -ne 0 ] ; then
create_statement=$(gh-ost-test-mysql-replica test -t -e "show create table _gh_ost_test_gho \G")

View File

@ -61,7 +61,7 @@ test_mysql_version() {
gh-ost-test-mysql-master -uroot -e "grant all on *.* to 'gh-ost'@'%'"
echo "### Running gh-ost tests for $mysql_version"
bash -x ./localtests/test.sh -b bin/gh-ost
./localtests/test.sh -b bin/gh-ost
find sandboxes -name "stop_all" | bash
}