Skip to content

Commit

Permalink
Add cockroach to Command's list of engines
Browse files Browse the repository at this point in the history
The list recognizes engine names on the command-line. Add a test to
ensure new engines added in the future won't be omitted. Thanks to
@NOBLES5E for the spot!
  • Loading branch information
theory committed Jul 29, 2023
1 parent eb0b947 commit 5278c38
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ Revision history for Perl extension App::Sqitch
enforcement was added.
- Removed remaining uses of the smartmatch operator, thus eliminating
the Perl 5.38 warnings about its deprecation. (#769)
- Added Cockroach to the list of valid engines recognized in command-line
arguments (and a test to ensure new engines won't be omitted in the
future). Thanks to @NOBLES5E for the spot (#772)!

1.3.1 2022-10-01T18:49:30Z
- Fixed a bug introduced in v1.3.0 where the Postgres engine would
Expand Down
3 changes: 3 additions & 0 deletions lib/App/Sqitch/Command.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use constant ENGINES => qw(
vertica
exasol
snowflake
cockroach
);

has sqitch => (
Expand Down Expand Up @@ -369,6 +370,8 @@ Returns the list of supported engines, currently:
=item * C<snowflake>
=item * C<cockroach>
=back
=head2 Class Methods
Expand Down
11 changes: 10 additions & 1 deletion t/command.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use strict;
use warnings;
use 5.010;
use utf8;
use Test::More tests => 198;
use Test::More tests => 199;
#use Test::More 'no_plan';
use Test::NoWarnings;
use List::Util qw(first);
Expand Down Expand Up @@ -131,6 +131,15 @@ DEBUG: {
'Should have sent error to debug';
}

##############################################################################
# Test ENGINES.s
my $dir = Path::Class::Dir->new(
Path::Class::File->new($INC{"App/Sqitch.pm"})->dir,
qw(Sqitch Engine),
);
my @exp = sort grep { s/\.pm$// } map { $_->basename } $dir->children;
is_deeply [sort $CLASS->ENGINES], \@exp, 'ENGINES should include all engines';

##############################################################################
# Test load().
ok $sqitch = App::Sqitch->new(config => $config), 'Load a sqitch object';
Expand Down

0 comments on commit 5278c38

Please sign in to comment.