[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.4-551-ge5dbd854de

? sunnavy sunnavy at bestpractical.com
Tue Jun 22 13:30:34 EDT 2021


The branch, 4.4-trunk has been updated
       via  e5dbd854deed76d12f1ec3d1dace0c66d267b7f6 (commit)
       via  7c811b9419539202985731eff7c44cea29b02853 (commit)
      from  e5d0991b91872e3bb397e88d6cb3c0875ba05520 (commit)

Summary of changes:
 t/sla/starts.t          | 2 ++
 t/ticket/sort-by-user.t | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 7c811b9419539202985731eff7c44cea29b02853
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jun 22 08:24:58 2021 +0800

    Update tests for Oracle as it's "NULLS LAST" in ascending order by default

diff --git a/t/ticket/sort-by-user.t b/t/ticket/sort-by-user.t
index 6c6ea27f4a..2fd088eab6 100644
--- a/t/ticket/sort-by-user.t
+++ b/t/ticket/sort-by-user.t
@@ -142,8 +142,8 @@ ok( $ret, "Added CF value 'Foo' to users[0]: $msg" );
 ( $ret, $msg ) = $users[1]->AddCustomFieldValue( Field => $cf, Value => 'Foo' );
 ok( $ret, "Added CF value 'Bar' to users[1]: $msg" );
 
-# In Pg, null values sort as if larger than any non-null value by default
-my $null_subject = RT->Config->Get('DatabaseType') eq 'Pg' ? 'zzz' : '-';
+# In Pg/Oracle, null values sort as if larger than any non-null value by default
+my $null_subject = RT->Config->Get('DatabaseType') =~ /Pg|Oracle/ ? 'zzz' : '-';
 
 @data = (
     { Subject => $null_subject },

commit e5dbd854deed76d12f1ec3d1dace0c66d267b7f6
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jun 23 01:21:15 2021 +0800

    Set fixed time to make sure tests pass all the time
    
    Previously tests could fail if current time is between 15:00 and 16:00
    on Monday/Tuesday: +1 hour will be in the day but +2 hours will be in
    the next working day, so the difference was not 1 hour.

diff --git a/t/sla/starts.t b/t/sla/starts.t
index 798bb977b7..f23bbcbb6b 100644
--- a/t/sla/starts.t
+++ b/t/sla/starts.t
@@ -97,6 +97,7 @@ diag 'check changing start time' if $ENV{'TEST_VERBOSE'};
         },
     ));
 
+    set_fixed_time('2021-06-21T10:00:00Z');
     my $ticket = RT::Ticket->new($RT::SystemUser);
     my ($id) = $ticket->Create( Queue => 'General', Subject => 'test sla start time change');
     ok $id, "Created ticket $id";
@@ -111,6 +112,7 @@ diag 'check changing start time' if $ENV{'TEST_VERBOSE'};
     $ticket->SetSLA('standard');
     my $reset_starts = $ticket->StartsObj->Unix;
     is $reset_starts, $starts, 'Start date reset';
+    restore_time();
 }
 
 done_testing;

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


More information about the rt-commit mailing list