mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-02 02:34:19 +00:00
Test pt-upgrade host-to-host. Implement diff_query_times(). Export $test_diff from PerconaTest instead of doing diag() in no_diff().
This commit is contained in:
@@ -70,6 +70,7 @@ our @EXPORT = qw(
|
||||
$dsn_opts
|
||||
$sandbox_version
|
||||
$can_load_data
|
||||
$test_diff
|
||||
);
|
||||
|
||||
our $trunk = $ENV{PERCONA_TOOLKIT_BRANCH};
|
||||
@@ -82,6 +83,8 @@ eval {
|
||||
|
||||
our $can_load_data = can_load_data();
|
||||
|
||||
our $test_diff = '';
|
||||
|
||||
our $dsn_opts = [
|
||||
{
|
||||
key => 'A',
|
||||
@@ -622,7 +625,7 @@ sub no_diff {
|
||||
}
|
||||
|
||||
# diff the outputs.
|
||||
my $out = `diff $res_file $cmp_file`;
|
||||
$test_diff = `diff $res_file $cmp_file 2>&1`;
|
||||
my $retval = $?;
|
||||
|
||||
# diff returns 0 if there were no differences,
|
||||
@@ -630,7 +633,6 @@ sub no_diff {
|
||||
$retval = $retval >> 8;
|
||||
|
||||
if ( $retval ) {
|
||||
diag($out);
|
||||
if ( $ENV{UPDATE_SAMPLES} || $args{update_sample} ) {
|
||||
`cat $tmp_file > $expected_output`;
|
||||
diag("Updated $expected_output");
|
||||
@@ -642,11 +644,11 @@ sub no_diff {
|
||||
unless $ENV{KEEP_OUTPUT} || $args{keep_output};
|
||||
|
||||
if ( $res_file ne $tmp_file ) {
|
||||
1 while unlink $res_file;
|
||||
unlink $res_file if -f $res_file;
|
||||
}
|
||||
|
||||
if ( $cmp_file ne $expected_output ) {
|
||||
1 while unlink $cmp_file;
|
||||
unlink $cmp_file if -f $cmp_file;
|
||||
}
|
||||
|
||||
return !$retval;
|
||||
|
Reference in New Issue
Block a user