[Rt-commit] rt branch, 4.4/sla-fastcgi-test-fix, created. rt-4.2.11-174-g4ef98fe

? sunnavy sunnavy at bestpractical.com
Thu Sep 17 10:26:42 EDT 2015


The branch, 4.4/sla-fastcgi-test-fix has been created
        at  4ef98fe62402425e8595d5ef7be78faae5daa4a7 (commit)

- Log -----------------------------------------------------------------
commit 4ef98fe62402425e8595d5ef7be78faae5daa4a7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Sep 17 22:21:54 2015 +0800

    put config set in "use RT::Test ..." to make fastcgi tests happy
    
    otherwise fastcgi server won't load the config

diff --git a/t/sla/web.t b/t/sla/web.t
index d62d45b..b59cccd 100644
--- a/t/sla/web.t
+++ b/t/sla/web.t
@@ -1,29 +1,31 @@
 use strict;
 use warnings;
 
-my $now;
-
 BEGIN {
-    $now = time();
     use Test::MockTime 'set_fixed_time';
-    set_fixed_time( $now );
-
-    use RT::Test tests => undef;
+    use constant TIME => 1442455200;
+    set_fixed_time(TIME);
+
+    use RT::Test
+        tests => undef,
+        config => "use Test::MockTime 'set_fixed_time'; set_fixed_time(". TIME . q!);
+            Set( %ServiceAgreements, (
+            Default => '2',
+            Levels  => {
+                '2' => {
+                    StartImmediately => 1,
+                    Response => { RealMinutes => 60 * 2 },
+                },
+                '4' => {
+                    StartImmediately => 1,
+                    Response => { RealMinutes => 60 * 4 },
+                },
+            },
+        ));!
+    ;
 }
 
-%RT::ServiceAgreements = (
-    Default => '2',
-    Levels  => {
-        '2' => {
-            StartImmediately => 1,
-            Response => { RealMinutes => 60 * 2 },
-        },
-        '4' => {
-            StartImmediately => 1,
-            Response => { RealMinutes => 60 * 4 },
-        },
-    },
-);
+my $now = TIME;
 
 my $queue = RT::Test->load_or_create_queue( Name => 'General' );
 

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


More information about the rt-commit mailing list