[Rt-commit] rt branch, 4.0/bootstrap-test-db-after-loading-classes, created. rt-4.0.6-126-ged33cba
Ruslan Zakirov
ruz at bestpractical.com
Sun May 27 06:31:18 EDT 2012
The branch, 4.0/bootstrap-test-db-after-loading-classes has been created
at ed33cbabd3f2d7eca369a283a1cc480e6627f97e (commit)
- Log -----------------------------------------------------------------
commit ed33cbabd3f2d7eca369a283a1cc480e6627f97e
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sun May 27 14:24:35 2012 +0400
load classes then bootstrap DB for tests
If not all classes are loaded then some insert operations
may fail. For example inserting ACL fails when class that
defines a right is not loaded. Many core classes are
already loaded to this moment, but not all. RT::Dashboard
defines a few rights and is not loaded.
We can do this as plugin paths are already set to correct
values and all overrides should be properly loaded. Talking
to DB during loading is prohibitted. If some code tries
to talk to DB while it's loading then it should be changed.
diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 7d69dd6..3e7c910 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -131,14 +131,14 @@ sub import {
if (RT->Config->Get('DevelMode')) { require Module::Refresh; }
- $class->bootstrap_db( %args );
-
RT::InitPluginPaths();
+ RT::InitClasses();
+
+ $class->bootstrap_db( %args );
__reconnect_rt()
unless $args{nodb};
- RT::InitClasses();
RT::InitLogging();
RT->Plugins;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list