Skip to content

Commit 1a4bdbd

Browse files
author
Shlomi Noach
authored
Merge pull request #508 from github/better-localtest-diff-output
better diff output in localtests
2 parents f1a76e6 + 5b51a28 commit 1a4bdbd

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

localtests/test.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ tests_path=$(dirname $0)
1111
test_logfile=/tmp/gh-ost-test.log
1212
ghost_binary=/tmp/gh-ost-test
1313
exec_command_file=/tmp/gh-ost-test.bash
14-
14+
orig_content_output_file=/gh-ost-test.orig.content.csv
15+
ghost_content_output_file=/gh-ost-test.ghost.content.csv
1516
test_pattern="${1:-.}"
1617

1718
master_host=
@@ -152,15 +153,17 @@ test_single() {
152153
fi
153154

154155
echo_dot
155-
orig_checksum=$(gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${orig_columns} from gh_ost_test ${order_by}" -ss | md5sum)
156-
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)
156+
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
157+
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
158+
orig_checksum=$(cat $orig_content_output_file | md5sum)
159+
ghost_checksum=$(cat $ghost_content_output_file | md5sum)
157160

158161
if [ "$orig_checksum" != "$ghost_checksum" ] ; then
159162
echo "ERROR $test_name: checksum mismatch"
160163
echo "---"
161-
gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${orig_columns} from gh_ost_test" -ss
162-
echo "---"
163-
gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "select ${ghost_columns} from _gh_ost_test_gho" -ss
164+
diff $orig_content_output_file $ghost_content_output_file
165+
166+
echo "diff $orig_content_output_file $ghost_content_output_file"
164167
return 1
165168
fi
166169
}

0 commit comments

Comments
 (0)