mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
Conditionalize IO::Uncompress::Inflate test. Make test names shorter, uniform.
This commit is contained in:
@@ -324,17 +324,18 @@ sub test_log_parser {
|
|||||||
close $fh;
|
close $fh;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
my ($base_file_name) = $args{file} =~ m/([^\/]+)$/;
|
||||||
is(
|
is(
|
||||||
$EVAL_ERROR,
|
$EVAL_ERROR,
|
||||||
'',
|
'',
|
||||||
"No error on $args{file}"
|
"$base_file_name: no errors"
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( defined $args{result} ) {
|
if ( defined $args{result} ) {
|
||||||
is_deeply(
|
is_deeply(
|
||||||
\@e,
|
\@e,
|
||||||
$args{result},
|
$args{result},
|
||||||
$args{file}
|
"$base_file_name: results"
|
||||||
) or print "Got: ", Dumper(\@e);
|
) or print "Got: ", Dumper(\@e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,7 +343,7 @@ sub test_log_parser {
|
|||||||
is(
|
is(
|
||||||
scalar @e,
|
scalar @e,
|
||||||
$args{num_events},
|
$args{num_events},
|
||||||
"$args{file} num_events"
|
"$base_file_name: $args{num_events} events"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,17 +381,18 @@ sub test_protocol_parser {
|
|||||||
close $fh;
|
close $fh;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
my ($base_file_name) = $args{file} =~ m/([^\/]+)$/;
|
||||||
is(
|
is(
|
||||||
$EVAL_ERROR,
|
$EVAL_ERROR,
|
||||||
'',
|
'',
|
||||||
"No error on $args{file}"
|
"$base_file_name: no errors"
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( defined $args{result} ) {
|
if ( defined $args{result} ) {
|
||||||
is_deeply(
|
is_deeply(
|
||||||
\@e,
|
\@e,
|
||||||
$args{result},
|
$args{result},
|
||||||
$args{file} . ($args{desc} ? ": $args{desc}" : '')
|
"$base_file_name: " . ($args{desc} || "results")
|
||||||
) or print "Got: ", Dumper(\@e);
|
) or print "Got: ", Dumper(\@e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,7 +400,7 @@ sub test_protocol_parser {
|
|||||||
is(
|
is(
|
||||||
scalar @e,
|
scalar @e,
|
||||||
$args{num_events},
|
$args{num_events},
|
||||||
"$args{file} num_events"
|
"$base_file_name: $args{num_events} events"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@ use MySQLProtocolParser;
|
|||||||
use TcpdumpParser;
|
use TcpdumpParser;
|
||||||
use PerconaTest;
|
use PerconaTest;
|
||||||
|
|
||||||
my $sample = "t/lib/samples/tcpdump/";
|
my $sample = "t/lib/samples/tcpdump";
|
||||||
my $tcpdump = new TcpdumpParser();
|
my $tcpdump = new TcpdumpParser();
|
||||||
my $protocol; # Create a new MySQLProtocolParser for each test.
|
my $protocol; # Create a new MySQLProtocolParser for each test.
|
||||||
|
|
||||||
@@ -487,6 +487,10 @@ test_protocol_parser(
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
eval { require IO::Uncompress::Inflate; };
|
||||||
|
SKIP: {
|
||||||
|
skip "IO::Uncompress::Inflate not installed", 2 if $EVAL_ERROR;
|
||||||
|
|
||||||
# Check data decompression.
|
# Check data decompression.
|
||||||
$protocol = new MySQLProtocolParser(
|
$protocol = new MySQLProtocolParser(
|
||||||
server => '127.0.0.1',
|
server => '127.0.0.1',
|
||||||
@@ -557,9 +561,9 @@ test_protocol_parser(
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
# TCP retransmission.
|
# TCP retransmission.
|
||||||
# Check data decompression.
|
|
||||||
$protocol = new MySQLProtocolParser(
|
$protocol = new MySQLProtocolParser(
|
||||||
server => '10.55.200.15',
|
server => '10.55.200.15',
|
||||||
);
|
);
|
||||||
|
@@ -15,7 +15,7 @@ use SlowLogParser;
|
|||||||
use PerconaTest;
|
use PerconaTest;
|
||||||
|
|
||||||
my $p = new SlowLogParser;
|
my $p = new SlowLogParser;
|
||||||
my $sample = "t/lib/samples/slowlogs/";
|
my $sample = "t/lib/samples/slowlogs";
|
||||||
|
|
||||||
# Check that I can parse a slow log in the default slow log format.
|
# Check that I can parse a slow log in the default slow log format.
|
||||||
test_log_parser(
|
test_log_parser(
|
||||||
|
Reference in New Issue
Block a user