[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.0-118-g330ef55

Shawn Moore shawn at bestpractical.com
Thu May 12 19:32:20 EDT 2016


The branch, 4.4-trunk has been updated
       via  330ef55309c55f2cf7c89e348f5ed3b7696a6f45 (commit)
      from  fbf5d07358478b7d0f5f49881feee1a6fc618134 (commit)

Summary of changes:
 lib/RT/Test.pm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 330ef55309c55f2cf7c89e348f5ed3b7696a6f45
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu May 12 23:27:36 2016 +0000

    Allow caller to specify whether test db should be dropped

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index aa9ec20..381c24b 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -616,14 +616,20 @@ sub _get_dbh {
 }
 
 sub __create_database {
+    my %args = (
+        # already dropped db in parallel tests, need to do so for other cases.
+        DropDatabase => $ENV{RT_TEST_PARALLEL} ? 0 : 1,
+
+        @_,
+    );
+
     # bootstrap with dba cred
     my $dbh = _get_dbh(
         RT::Handle->SystemDSN,
         $ENV{RT_DBA_USER}, $ENV{RT_DBA_PASSWORD}
     );
 
-    unless ( $ENV{RT_TEST_PARALLEL} ) {
-        # already dropped db in parallel tests, need to do so for other cases.
+    if ($args{DropDatabase}) {
         __drop_database( $dbh );
 
     }

-----------------------------------------------------------------------


More information about the rt-commit mailing list