Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
PERL-351 skip tests if database has auth enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Jun 10, 2014
1 parent cd49213 commit 2fc4aa5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

[Testing]

- PERL-351 fixed test failures if the local database has auth enabled;
tests will skip instead of fail

- PERL-356 enabled additional tests if the test database is a replica set
or sharded cluster

Expand Down
4 changes: 3 additions & 1 deletion t/lib/MongoDBTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ BEGIN {
host => $host, ssl => $ENV{MONGO_SSL}, find_master => 1
);
$testdb = $conn->get_database('testdb' . time()) or
die "Can't get database";
die "Can't get database\n";
eval { $conn->get_database("admin")->_try_run_command({ serverStatus => 1 }) }
or die "Database has auth enabled\n";
};

if ( $@ ) {
Expand Down

0 comments on commit 2fc4aa5

Please sign in to comment.