[Rt-commit] rtir branch, 4.0/pass-tests, created. 4.0.0-73-gae37a617

? sunnavy sunnavy at bestpractical.com
Tue Mar 6 17:19:28 EST 2018


The branch, 4.0/pass-tests has been created
        at  ae37a617918ef586969e8fde133093b64c574e8d (commit)

- Log -----------------------------------------------------------------
commit a89f3748be5a991bf5f127783a43cc4fa11df52d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 00:12:08 2018 +0800

    Auth::Crypt has been removed from plugin since RT 4.4

diff --git a/lib/RT/IR/Test/GnuPG.pm b/lib/RT/IR/Test/GnuPG.pm
index f619a344..82bb0de8 100644
--- a/lib/RT/IR/Test/GnuPG.pm
+++ b/lib/RT/IR/Test/GnuPG.pm
@@ -96,7 +96,7 @@ Set(\%GnuPG, (
     OutgoingMessagesFormat => 'RFC',
 ));
 Set(\%GnuPGOptions => \%{ $dumped_gnupg_options });
-Set(\@MailPlugins => qw(Auth::MailFrom Auth::Crypt));
+Set(\@MailPlugins => qw(Auth::MailFrom));
 };
 
 }

commit 13f712fc012093402b25780bb7dd3c7c597d97af
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 00:23:24 2018 +0800

    "undef $m" to make tests exit cleanly
    
    There is code to help avoid this statement in RT 4.4-trunk(e9960b2e), so
    there'll be no need to do so for future versions of RT.
    
    Once bound to those RT versions, we can then safely remove all the
    "undef $m" in tests.

diff --git a/t/report/split.t b/t/report/split.t
index 92b34680..9e09d3c1 100644
--- a/t/report/split.t
+++ b/t/report/split.t
@@ -105,4 +105,5 @@ sub create_incident_report {
     return $ir;
 }
 
+undef $m;
 done_testing;

commit 60f92f67727fad7ed0b7377cbb5588e7ed6c51dc
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 00:23:46 2018 +0800

    update tests for the changed content returned from whois.verisign-grs.com
    
    "No match" is probably a better test string.

diff --git a/t/tools/lookup.t b/t/tools/lookup.t
index 7f5e8613..32e20635 100644
--- a/t/tools/lookup.t
+++ b/t/tools/lookup.t
@@ -50,7 +50,7 @@ SKIP:{
     $agent->form_name('ToolFormWhois');
     $agent->click;
     $agent->content_contains('WHOIS Results');
-    $agent->content_contains('Domain names in the .com and .net domains');
+    $agent->content_contains('No match');
 }
 }
 

commit d88dfe2156f1df546a60b671afa97405470aaa84
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 03:44:04 2018 +0800

    remove duplicated "undef $agent"

diff --git a/t/tools/lookup.t b/t/tools/lookup.t
index 32e20635..39b088ef 100644
--- a/t/tools/lookup.t
+++ b/t/tools/lookup.t
@@ -54,7 +54,5 @@ SKIP:{
 }
 }
 
-undef $agent;
-
 undef $agent;
 done_testing;

commit 95f6989c77d0b1ac564264afb2c6ff0e6d02a726
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 04:24:35 2018 +0800

    no need to parse URI if it's empty
    
    Otherwise we may get warnings like "Couldn't resolve '' into a URI".
    
    The reason that NewValue could be empty is in Condition
    "RTIR_LinkingToIncident.pm", besides "AddLink" transactions, IR "Create"
    transactions could also get passed, which don't have NewValue.
    
    Since empty URIs can't be successfully parsed anyway, this change
    doesn't change the action's behavior.

diff --git a/lib/RT/Action/RTIR_MergeIPs.pm b/lib/RT/Action/RTIR_MergeIPs.pm
index 08ef3288..2ddda30e 100644
--- a/lib/RT/Action/RTIR_MergeIPs.pm
+++ b/lib/RT/Action/RTIR_MergeIPs.pm
@@ -61,7 +61,7 @@ sub Commit {
     my $self = shift;
 
     my $txn = $self->TransactionObj;
-    my $uri = $txn->NewValue ||'';
+    my $uri = $txn->NewValue or return 0;
 
     my $uri_obj = RT::URI->new( $self->CurrentUser );
     my ($status) = $uri_obj->FromURI( $uri );

commit 5e6586cc96b10110f683d57460c5c2d77d52d6bf
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 04:48:13 2018 +0800

    refactor goto_create_rtir_ticket to use real lifecycle name
    
    Old approach is a fragile hack of the queue name, which is not always
    correct because we have customized queue names in some tests.

diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index 3c6b5d82..b0825717 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -73,10 +73,12 @@ sub create_countermeasure {
 
 sub goto_create_rtir_ticket {
     my $self = shift;
-    my $queue = shift; # we play a dumb game to change queues to lifecycles
+    my $queue = shift;
     local $Test::Builder::Level = $Test::Builder::Level + 1;
-    my $lifecycle = lc( $queue);
-    $lifecycle =~ s/ /_/;
+
+    my $queue_obj = RT::Queue->new(RT->SystemUser);
+    $queue_obj->Load($queue);
+    my $lifecycle = $queue_obj->Lifecycle || 'default';
 
     $self->get_ok("/RTIR/CreateInQueue.html?Lifecycle=$lifecycle");
     $self->click_through_createinqueue( $queue );

commit 9e4a11b2f4d94866d868fd5f1f037e21e5e09d87
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 05:08:41 2018 +0800

    turn debug on for Net::Whois::RIPE only when we have debug log
    
    It's not necessary to always enable debug there.

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 2b370c52..81568f5c 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -651,7 +651,14 @@ sub WhoisLookup {
     $port = 43 unless ($port || '') =~ /^\d+$/;
 
     use Net::Whois::RIPE;
-    my $whois = Net::Whois::RIPE->new( $host, Port => $port, Debug => 1 );
+    my $debug;
+    for my $log_config ( qw/LogToSyslog LogToSTDERR LogToFile/ ) {
+        if ( ( RT->Config->Get( $log_config ) // '' ) eq 'debug' ) {
+            $debug = 1;
+            last;
+        }
+    }
+    my $whois = Net::Whois::RIPE->new( $host, Port => $port, Debug => $debug || 0 );
     my $iterator;
     $iterator = $whois->query_iterator( $args{'Query'} )
         if $whois;

commit c1c1c53e000fa5cd5ca9aaa6ad2fc02b3ff742d9
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 05:11:54 2018 +0800

    add a missing warnings check for t/tools/lookup.t
    
    Note that "info" log level is set to turn off debug mode of
    Net::Whois::RIPE

diff --git a/t/tools/lookup.t b/t/tools/lookup.t
index 39b088ef..d62c2dd2 100644
--- a/t/tools/lookup.t
+++ b/t/tools/lookup.t
@@ -3,6 +3,8 @@ use warnings;
 
 use RT::IR::Test tests => undef;
 
+RT->Config->Set( LogToFile => 'info' );
+
 RT::Test->started_ok;
 my $agent = default_agent();
 
@@ -20,13 +22,14 @@ diag "Test Lookup page directly";
     $agent->get_ok("/RTIR/Tools/Lookup.html", "Loaded Lookup page");
 
 SKIP:{
-    skip "No network", 2 if $no_network;
+    skip "No network", 3 if $no_network;
     $agent->form_name('ToolFormWhois');
     $agent->field('q', 'mit.edu');
     $agent->select('WhoisServer', 'IANA');
     $agent->click;
     $agent->content_contains('WHOIS Results');
     $agent->content_contains('IANA WHOIS server');
+    $agent->next_warning_like( qr/Asked to run a full text search from Lookup\.html/ );
 }
 }
 

commit 558004ba5075c1e05d6f1689ab4723d9ae20c988
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 05:13:35 2018 +0800

    add missing warnings checks for gpg tests

diff --git a/t/gnupg/on-create.t b/t/gnupg/on-create.t
index 50160f72..f991b407 100644
--- a/t/gnupg/on-create.t
+++ b/t/gnupg/on-create.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::IR::Test::GnuPG tests => 61, gnupg_options => { passphrase => 'rt-test' };
+use RT::IR::Test::GnuPG tests => undef, gnupg_options => { passphrase => 'rt-test' };
 
 my $queue = RT::Test->load_or_create_queue(
     Name              => 'Incident Reports',
@@ -49,6 +49,9 @@ 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->no_leftover_warnings_ok;
 }
 
 diag "import first key of rt-test\@example.com";
diff --git a/t/gnupg/on-incident.t b/t/gnupg/on-incident.t
index 3fde87d2..8d6a7f6b 100644
--- a/t/gnupg/on-incident.t
+++ b/t/gnupg/on-incident.t
@@ -43,6 +43,11 @@ 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'
         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/public key not found/) for 1 .. 2;
+    $agent->no_leftover_warnings_ok;
 }
 
 diag 'import rt-recipient at example.com key and sign it';
@@ -84,6 +89,8 @@ 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->no_leftover_warnings_ok;
 }
 
 undef $agent;
diff --git a/t/gnupg/on-update.t b/t/gnupg/on-update.t
index fee59df9..28919c53 100644
--- a/t/gnupg/on-update.t
+++ b/t/gnupg/on-update.t
@@ -59,6 +59,9 @@ 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->no_leftover_warnings_ok;
 }
 
 diag "import first key of rt-test\@example.com";

commit ae37a617918ef586969e8fde133093b64c574e8d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 7 05:15:35 2018 +0800

    use string cmparison for "Constituency" checks and take care of empty values

diff --git a/html/RTIR/Merge/index.html b/html/RTIR/Merge/index.html
index 23a9b00e..f3ce0a30 100644
--- a/html/RTIR/Merge/index.html
+++ b/html/RTIR/Merge/index.html
@@ -99,8 +99,8 @@ if ( $MergeTicket ) {
         }
 
         if (RT::IR->StrictConstituencyLinking) {
-        if (RT::IR->ConstituencyFor($Ticket) 
-            != RT::IR->ConstituencyFor($MergeTicket)) {
+        if ( (RT::IR->ConstituencyFor($Ticket) // '')
+            ne (RT::IR->ConstituencyFor($MergeTicket) // '') ) {
             push @results, 
             loc("Merge failed: Ticket #[_1] is associated with a different constituency", 
                 $MergeTicket->Id );

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


More information about the rt-commit mailing list