testing framework: adding more warnings about possible data loss
authorAndrew Moore <andrew.moore@liblime.com>
Tue, 22 Apr 2008 14:00:42 +0000 (09:00 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 22 Apr 2008 14:09:05 +0000 (09:09 -0500)
I'm adding some more warnings in Makefile.PL to indicate that you WILL lose the data
in your testing database.

I've also relaxed the requirement that the teting database have "test" in its name.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Makefile.PL
t/lib/KohaTest.pm

index 3a05922..7f04cb7 100644 (file)
@@ -1065,9 +1065,19 @@ Would you like to run the database-dependent test suite?);
   if ( $config{'RUN_DATABASE_TESTS'} eq 'yes' ) {
       $config{'TEST_DB_TYPE'} = $config{'DB_TYPE'};
       $config{'TEST_DB_HOST'} = $config{'DB_HOST'};
-      $msg = q(
+      $msg = q(TEST DATABASE
+
+THE DATA IN THIS DATABASE WILL BE DESTROYED during the process of
+testing. Please don't do this on your production database. It is not
+reversable.
+
+YOU WILL SUFFER DATA LOSS if you run this test suite on your test
+database. You are better off not running this optional test suite than
+doing it in a database that you don't want to lose.
+
 Please specify the name of the test database to be
 used by Koha);
+      
     $config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values);
 
       $msg = q(
index 9286306..0a21b21 100644 (file)
@@ -28,31 +28,6 @@ these are run once, at the beginning of the whole test suite
 
 =cut
 
-=head2 startup_10_prepare_database
-
-prepare a blank database.
-
-This ends up getting run once for each test module, so that's several
-times throughout the test suite. That may be too many times to refresh
-the database. We may have to tune that.
-
-=cut
-
-sub startup_10_prepare_database : Test(startup => 1) {
-    my $self = shift;
-    # this is how I'm refreshing my database for now.  I'll think of
-    # something better later.  Eventually, I'd like to drop the
-    # database entirely and use the regular install code to rebuild a
-    # base database.
-    my $class = ref $self;
-
-    # like( C4::Context->config( 'database '), qr/test$/, 'using test database: ' . C4::Context->config( 'database' ) )
-    like( C4::Context->database(), qr/test$/, 'using test database: ' . C4::Context->database() )
-      or BAIL_OUT( 'This appears to not be a test database.' );
-
-    return;
-}
-
 sub startup_15_truncate_tables : Test( startup => 1 ) {
     my $self = shift;