Files
percona-toolkit/t/pt-sift/pt-sift.t
T
Sveta Smirnova 380a8085de PT-2498 - pt-sift does not work starting from version 3.7.0
- Added missed module into the tool
- Modified test case, so it tests if this interactive tool works, so we
  do not miss cases like this in the future
2025-12-01 16:21:11 +03:00

40 lines
1.0 KiB
Perl

#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More tests => 2;
use PerconaTest;
my ($tool) = $PROGRAM_NAME =~ m/([\w-]+)\.t$/;
my $output = `$trunk/bin/$tool $trunk/bin 2>&1`;
# https://perconadev.atlassian.net/browse/PT-2498
# We do not test interactive tool here
# But we at least ensure it works and prints
# proper error message if called without correct path
isnt(
$?,
0,
"Error for the directory that does not contain pt-stalk files"
) or diag($output);
like(
$output,
qr/Error: There are no pt-stalk files in $trunk\/bin/,
"Correct error message"
) or diag($output);
# #############################################################################
# Done.
# #############################################################################
exit;