From 1a6d84c4a6fd5d9ed44b3a4b618adc37e2b14fde Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Tue, 22 Apr 2008 09:00:42 -0500 Subject: [PATCH] testing framework: adding more warnings about possible data loss 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 --- Makefile.PL | 12 +++++++++++- t/lib/KohaTest.pm | 25 ------------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 3a05922bc9..7f04cb79e6 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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( diff --git a/t/lib/KohaTest.pm b/t/lib/KohaTest.pm index 92863067cc..0a21b2117c 100644 --- a/t/lib/KohaTest.pm +++ b/t/lib/KohaTest.pm @@ -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; -- 2.39.5