From 5b51a2863a34467fc231cc5a19914b85de4f0e90 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 24 Oct 2017 15:24:31 +0300 Subject: [PATCH] better diff output in localtests --- localtests/test.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/localtests/test.sh b/localtests/test.sh index 45464b6..b901ce3 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -11,7 +11,8 @@ tests_path=$(dirname $0) test_logfile=/tmp/gh-ost-test.log ghost_binary=/tmp/gh-ost-test exec_command_file=/tmp/gh-ost-test.bash - +orig_content_output_file=/gh-ost-test.orig.content.csv +ghost_content_output_file=/gh-ost-test.ghost.content.csv test_pattern="${1:-.}" master_host= @@ -152,15 +153,17 @@ test_single() { fi echo_dot - orig_checksum=$(gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${orig_columns} from gh_ost_test ${order_by}" -ss | md5sum) - ghost_checksum=$(gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${ghost_columns} from _gh_ost_test_gho ${order_by}" -ss | md5sum) + gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${orig_columns} from gh_ost_test ${order_by}" -ss > $orig_content_output_file + gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${ghost_columns} from _gh_ost_test_gho ${order_by}" -ss > $ghost_content_output_file + orig_checksum=$(cat $orig_content_output_file | md5sum) + ghost_checksum=$(cat $ghost_content_output_file | md5sum) if [ "$orig_checksum" != "$ghost_checksum" ] ; then echo "ERROR $test_name: checksum mismatch" echo "---" - gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${orig_columns} from gh_ost_test" -ss - echo "---" - gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${ghost_columns} from _gh_ost_test_gho" -ss + diff $orig_content_output_file $ghost_content_output_file + + echo "diff $orig_content_output_file $ghost_content_output_file" return 1 fi }