[Rt-commit] rtir branch, master, updated. 4.0.1rc1-144-g865dc832

Jim Brandt jbrandt at bestpractical.com
Fri May 29 14:23:26 EDT 2020


The branch, master has been updated
       via  865dc83211b0c89208dee3d62836cace0333d38e (commit)
       via  bb3a43721c44b84a77b8e1a02368207c46d5eb6c (commit)
       via  764d85740bf12ed49834c8b58cafba491fb8dab0 (commit)
       via  aa4f2ca37eddea3d229c37c5168af55e57d0d342 (commit)
      from  eb6766a7faa2b6898008132ab3099a08d24ff4b0 (commit)

Summary of changes:
 lib/RT/IR/Test/GnuPG.pm | 5 ++---
 t/gnupg/on-create.t     | 2 +-
 t/gnupg/on-incident.t   | 8 ++++----
 t/gnupg/on-update.t     | 2 +-
 4 files changed, 8 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit aa4f2ca37eddea3d229c37c5168af55e57d0d342
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 21 22:00:38 2020 +0800

    Test the important part of gpg warning message instead
    
    The warning is like:
    
        gpg: keyring `/var/folders/_7/nzkgcc8n4gl0y5psm8km1sfw0000gn/T/CyykLDL13f/secring.gpg' created
        gpg: no default secret key: secret key not available
        gpg: signing failed: secret key not available
    
    Apparently the "secret key not available" is the part that matters

diff --git a/t/gnupg/on-incident.t b/t/gnupg/on-incident.t
index 8d6a7f6b..281464d7 100644
--- a/t/gnupg/on-incident.t
+++ b/t/gnupg/on-incident.t
@@ -45,7 +45,7 @@ diag "check that things don't work if there is no key";
         or diag "Emails' have been sent: \n". join "\n\n", @mail;
 
     $agent->next_warning_like(qr/public key not found/) for 1 .. 2;
-    $agent->next_warning_like(qr/keyring.+created/);
+    $agent->next_warning_like(qr/secret key not available/);
     $agent->next_warning_like(qr/public key not found/) for 1 .. 2;
     $agent->no_leftover_warnings_ok;
 }

commit 764d85740bf12ed49834c8b58cafba491fb8dab0
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 21 22:05:05 2020 +0800

    Update warning message tests for gpg 2.2

diff --git a/t/gnupg/on-create.t b/t/gnupg/on-create.t
index f991b407..6170a7a7 100644
--- a/t/gnupg/on-create.t
+++ b/t/gnupg/on-create.t
@@ -50,7 +50,7 @@ diag "check that things don't work if there is no key";
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
 
-    $agent->next_warning_like(qr/public key not found/) for 1 .. 2;
+    $agent->next_warning_like(qr/public key not found|No public key/) for 1 .. 2;
     $agent->no_leftover_warnings_ok;
 }
 
diff --git a/t/gnupg/on-incident.t b/t/gnupg/on-incident.t
index 281464d7..5a610478 100644
--- a/t/gnupg/on-incident.t
+++ b/t/gnupg/on-incident.t
@@ -44,9 +44,9 @@ diag "check that things don't work if there is no key";
     ok !@mail, 'there are no outgoing emails'
         or diag "Emails' have been sent: \n". join "\n\n", @mail;
 
-    $agent->next_warning_like(qr/public key not found/) for 1 .. 2;
-    $agent->next_warning_like(qr/secret key not available/);
-    $agent->next_warning_like(qr/public key not found/) for 1 .. 2;
+    $agent->next_warning_like(qr/public key not found|No public key/) for 1 .. 2;
+    $agent->next_warning_like(qr/secret key not available|No secret key/);
+    $agent->next_warning_like(qr/public key not found|No public key/) for 1 .. 2;
     $agent->no_leftover_warnings_ok;
 }
 
@@ -89,7 +89,7 @@ diag "check that things don't work if there is no key";
 
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
-    $agent->next_warning_like(qr/public key not found/) for 1 .. 8;
+    $agent->next_warning_like(qr/public key not found|No public key/) for 1 .. 8;
     $agent->no_leftover_warnings_ok;
 }
 
diff --git a/t/gnupg/on-update.t b/t/gnupg/on-update.t
index 28919c53..9a1f393c 100644
--- a/t/gnupg/on-update.t
+++ b/t/gnupg/on-update.t
@@ -60,7 +60,7 @@ diag "check that things don't work if there is no key";
     my @mail = RT::Test->fetch_caught_mails;
     ok !@mail, 'there are no outgoing emails';
 
-    $agent->next_warning_like(qr/public key not found/) for 1 .. 2;
+    $agent->next_warning_like(qr/public key not found|No public key/) for 1 .. 2;
     $agent->no_leftover_warnings_ok;
 }
 

commit bb3a43721c44b84a77b8e1a02368207c46d5eb6c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat May 23 01:01:38 2020 +0800

    Ensure that Test::NoWarnings is skipped if skip_all is used
    
    Without it, gpg tests could fail like:
    
    t/gnupg/on-create.t (Wstat: 0 Tests: 1 Failed: 1)
      Failed test:  1
      Parse errors: Bad plan.  You planned 0 tests but ran 1.
    
    The 1 unexpected test is the had_no_warnings in RT::Test
    
    See also 7d55aee8ff in RT.

diff --git a/lib/RT/IR/Test/GnuPG.pm b/lib/RT/IR/Test/GnuPG.pm
index d20ad8cc..c4d81935 100644
--- a/lib/RT/IR/Test/GnuPG.pm
+++ b/lib/RT/IR/Test/GnuPG.pm
@@ -56,11 +56,10 @@ use File::Temp qw(tempdir);
 sub import {
     my $class = shift;
     my %args  = @_;
-    my $t     = $class->builder;
 
-    $t->plan( skip_all => 'GnuPG required.' )
+    RT::Test::plan( skip_all => 'GnuPG required.' )
       unless eval { require GnuPG::Interface; 1 };
-    $t->plan( skip_all => 'gpg executable is required.' )
+    RT::Test::plan( skip_all => 'gpg executable is required.' )
       unless RT::Test->find_executable('gpg');
 
     $class->SUPER::import(%args);

commit 865dc83211b0c89208dee3d62836cace0333d38e
Merge: eb6766a7 bb3a4372
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri May 29 14:15:10 2020 -0400

    Merge branch '5.0/fix-tests-for-gpg-2.2'


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


More information about the rt-commit mailing list