[Rt-commit] rt branch, psgi, updated. rt-3.9.4-215-g241134d

Chia-liang Kao clkao at bestpractical.com
Mon Oct 25 09:33:13 EDT 2010


The branch, psgi has been updated
       via  241134d16929e8e644542b173e27fb3fcb20e1a6 (commit)
      from  effdf39fcb09f1efac5c701eb338ccc1ab1dd3e8 (commit)

Summary of changes:
 sbin/rt-server.in                         |   10 ++++++++--
 t/data/configs/apache2.2+fastcgi.conf.in  |    2 +-
 t/data/configs/apache2.2+mod_perl.conf.in |    1 +
 3 files changed, 10 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 241134d16929e8e644542b173e27fb3fcb20e1a6
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Mon Oct 25 21:33:17 2010 +0800

    test mode for rt-server so we have stashwarnings.

diff --git a/sbin/rt-server.in b/sbin/rt-server.in
index e4f61da..5ea5573 100755
--- a/sbin/rt-server.in
+++ b/sbin/rt-server.in
@@ -129,10 +129,16 @@ EOF
 }
 
 require RT::Interface::Web::Handler;
+my $app = RT::Interface::Web::Handler->PSGIApp;
 
 # when used as a psgi file
 unless ($0 eq __FILE__) {
-    return RT::Interface::Web::Handler->PSGIApp;
+    if ($ENV{RT_TESTING}) {
+        require Plack::Middleware::Test::StashWarnings;
+        $app = Plack::Middleware::Test::StashWarnings->wrap($app);
+    }
+
+    return $app;
 }
 
 
@@ -166,7 +172,7 @@ unless ($r->{env} eq 'development') {
         print STDERR "$name: Accepting connections at $proto://$host:$args->{port}/\n";
     };
 }
-eval { $r->run(RT::Interface::Web::Handler->PSGIApp) };
+eval { $r->run($app) };
 if (my $err = $@) {
     handle_startup_error($err);
 }
diff --git a/t/data/configs/apache2.2+fastcgi.conf.in b/t/data/configs/apache2.2+fastcgi.conf.in
index 1ee521e..dc045e9 100644
--- a/t/data/configs/apache2.2+fastcgi.conf.in
+++ b/t/data/configs/apache2.2+fastcgi.conf.in
@@ -28,7 +28,7 @@ LogLevel debug
 
 AddDefaultCharset UTF-8
 
-FastCgiServer %%RT_SBIN_PATH%%/rt-server.fcgi -processes 1 -idle-timeout 180 -initial-env RT_SITE_CONFIG=%%RT_SITE_CONFIG%%
+FastCgiServer %%RT_SBIN_PATH%%/rt-server.fcgi -processes 1 -idle-timeout 180 -initial-env RT_SITE_CONFIG=%%RT_SITE_CONFIG%% -initial-env RT_TESTING=1
 
 Alias /NoAuth/images/ %%DOCUMENT_ROOT%%/NoAuth/images/
 ScriptAlias / %%RT_SBIN_PATH%%/rt-server.fcgi/
diff --git a/t/data/configs/apache2.2+mod_perl.conf.in b/t/data/configs/apache2.2+mod_perl.conf.in
index 472c79b..b30c9d2 100644
--- a/t/data/configs/apache2.2+mod_perl.conf.in
+++ b/t/data/configs/apache2.2+mod_perl.conf.in
@@ -37,5 +37,6 @@ DocumentRoot "%%DOCUMENT_ROOT%%"
     SetHandler perl-script
     PerlResponseHandler Plack::Handler::Apache2
     PerlSetVar psgi_app %%RT_SBIN_PATH%%/rt-server
+    PerlSetEnv RT_TESTING 1
 </Directory>
 

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


More information about the Rt-commit mailing list