[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.4-235-ga35c225

? sunnavy sunnavy at bestpractical.com
Mon Nov 1 04:26:53 EDT 2010


The branch, 3.9-trunk has been updated
       via  a35c225c2fa8965aaefd5a542377d5ba75bfd52b (commit)
       via  a0cb464e8e836c251dda563100a5958029f6656c (commit)
      from  2465059f57ab2f2f58994478d8ed3021b3a1703e (commit)

Summary of changes:
 lib/RT/Test/GnuPG.pm                               |   23 ++++++-----
 ...gnupg-outgoing.t => gnupg-outgoing-encrypted.t} |   41 ++++++-------------
 .../{gnupg-outgoing.t => gnupg-outgoing-plain.t}   |   40 ++++++-------------
 .../{gnupg-outgoing.t => gnupg-outgoing-signed.t}  |   41 ++++++-------------
 ...utgoing.t => gnupg-outgoing-signed_encrypted.t} |   42 +++++++-------------
 5 files changed, 65 insertions(+), 122 deletions(-)
 copy t/mail/{gnupg-outgoing.t => gnupg-outgoing-encrypted.t} (67%)
 copy t/mail/{gnupg-outgoing.t => gnupg-outgoing-plain.t} (67%)
 copy t/mail/{gnupg-outgoing.t => gnupg-outgoing-signed.t} (67%)
 rename t/mail/{gnupg-outgoing.t => gnupg-outgoing-signed_encrypted.t} (67%)

- Log -----------------------------------------------------------------
commit a0cb464e8e836c251dda563100a5958029f6656c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Nov 1 16:21:11 2010 +0800

    use ref directly, no need shallow copy

diff --git a/lib/RT/Test/GnuPG.pm b/lib/RT/Test/GnuPG.pm
index 6520d40..cd1bb72 100644
--- a/lib/RT/Test/GnuPG.pm
+++ b/lib/RT/Test/GnuPG.pm
@@ -111,18 +111,21 @@ sub update_ticket {
 }
 
 sub categorize_emails {
-    my %mail = %{ shift @_ };
-    my %args = %{ shift @_ };
+    my $mail = shift;
+    my $args = shift;
     my @mail = @_;
 
-    if ( $args{'Sign'} && $args{'Encrypt'} ) {
-        push @{ $mail{'signed_encrypted'} }, @mail;
-    } elsif ( $args{'Sign'} ) {
-        push @{ $mail{'signed'} }, @mail;
-    } elsif ( $args{'Encrypt'} ) {
-        push @{ $mail{'encrypted'} }, @mail;
-    } else {
-        push @{ $mail{'plain'} }, @mail;
+    if ( $args->{'Sign'} && $args->{'Encrypt'} ) {
+        push @{ $mail->{'signed_encrypted'} }, @mail;
+    }
+    elsif ( $args->{'Sign'} ) {
+        push @{ $mail->{'signed'} }, @mail;
+    }
+    elsif ( $args->{'Encrypt'} ) {
+        push @{ $mail->{'encrypted'} }, @mail;
+    }
+    else {
+        push @{ $mail->{'plain'} }, @mail;
     }
 }
 

commit a35c225c2fa8965aaefd5a542377d5ba75bfd52b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Nov 1 16:22:04 2010 +0800

    split t/mail/gnupg-outgoing.t to 4 tests for parallel testing

diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing-encrypted.t
similarity index 67%
copy from t/mail/gnupg-outgoing.t
copy to t/mail/gnupg-outgoing-encrypted.t
index 400bb4a..2aed058 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing-encrypted.t
@@ -3,46 +3,35 @@ use strict;
 use warnings;
 
 use RT::Test::GnuPG
-  tests         => 389,
+  tests         => 101,
   gnupg_options => {
     passphrase    => 'rt-test',
     'trust-model' => 'always',
   };
 
 RT::Test->import_gnupg_key('rt-recipient at example.com');
-RT::Test->import_gnupg_key('rt-test at example.com', 'public');
+RT::Test->import_gnupg_key( 'rt-test at example.com', 'public' );
 
 my $queue = RT::Test->load_or_create_queue(
     Name              => 'Regression',
     CorrespondAddress => 'rt-recipient at example.com',
     CommentAddress    => 'rt-recipient at example.com',
+    Encrypt           => 1,
 );
 ok $queue && $queue->id, 'loaded or created queue';
 
-my ($baseurl, $m) = RT::Test->started_ok;
+my ( $baseurl, $m ) = RT::Test->started_ok;
 ok $m->login, 'logged in';
 
-my @variants = (
-    {},
-    { Sign => 1 },
-    { Encrypt => 1 },
-    { Sign => 1, Encrypt => 1 },
-);
+my @variants =
+  ( {}, { Sign => 1 }, { Encrypt => 1 }, { Sign => 1, Encrypt => 1 }, );
 
 # collect emails
-my %mail = (
-    plain            => [],
-    signed           => [],
-    encrypted        => [],
-    signed_encrypted => [],
-);
+my %mail;
 
 # create a ticket for each combination
-foreach my $queue_set ( @variants ) {
-    set_queue_crypt_options( $queue, %$queue_set );
-    foreach my $ticket_set ( @variants ) {
-        create_a_ticket( $queue, \%mail, $m, %$ticket_set );
-    }
+foreach my $ticket_set (@variants) {
+    create_a_ticket( $queue, \%mail, $m, %$ticket_set );
 }
 
 my $tid;
@@ -57,22 +46,18 @@ my $tid;
 }
 
 # again for each combination add a reply message
-foreach my $queue_set ( @variants ) {
-    set_queue_crypt_options( $queue, %$queue_set );
-    foreach my $ticket_set ( @variants ) {
-        update_ticket( $tid, \%mail, $m, %$ticket_set );
-    }
+foreach my $ticket_set (@variants) {
+    update_ticket( $tid, \%mail, $m, %$ticket_set );
 }
 
-
 # ------------------------------------------------------------------------------
 # now delete all keys from the keyring and put back secret/pub pair for rt-test@
 # and only public key for rt-recipient@ so we can verify signatures and decrypt
 # like we are on another side recieve emails
 # ------------------------------------------------------------------------------
 
-unlink $_ foreach glob( RT->Config->Get('GnuPGOptions')->{'homedir'} ."/*" );
-RT::Test->import_gnupg_key('rt-recipient at example.com', 'public');
+unlink $_ foreach glob( RT->Config->Get('GnuPGOptions')->{'homedir'} . "/*" );
+RT::Test->import_gnupg_key( 'rt-recipient at example.com', 'public' );
 RT::Test->import_gnupg_key('rt-test at example.com');
 
 $queue = RT::Test->load_or_create_queue(
diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing-plain.t
similarity index 67%
copy from t/mail/gnupg-outgoing.t
copy to t/mail/gnupg-outgoing-plain.t
index 400bb4a..92b9316 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing-plain.t
@@ -3,14 +3,14 @@ use strict;
 use warnings;
 
 use RT::Test::GnuPG
-  tests         => 389,
+  tests         => 101,
   gnupg_options => {
     passphrase    => 'rt-test',
     'trust-model' => 'always',
   };
 
 RT::Test->import_gnupg_key('rt-recipient at example.com');
-RT::Test->import_gnupg_key('rt-test at example.com', 'public');
+RT::Test->import_gnupg_key( 'rt-test at example.com', 'public' );
 
 my $queue = RT::Test->load_or_create_queue(
     Name              => 'Regression',
@@ -19,30 +19,18 @@ my $queue = RT::Test->load_or_create_queue(
 );
 ok $queue && $queue->id, 'loaded or created queue';
 
-my ($baseurl, $m) = RT::Test->started_ok;
+my ( $baseurl, $m ) = RT::Test->started_ok;
 ok $m->login, 'logged in';
 
-my @variants = (
-    {},
-    { Sign => 1 },
-    { Encrypt => 1 },
-    { Sign => 1, Encrypt => 1 },
-);
+my @variants =
+  ( {}, { Sign => 1 }, { Encrypt => 1 }, { Sign => 1, Encrypt => 1 }, );
 
 # collect emails
-my %mail = (
-    plain            => [],
-    signed           => [],
-    encrypted        => [],
-    signed_encrypted => [],
-);
+my %mail;
 
 # create a ticket for each combination
-foreach my $queue_set ( @variants ) {
-    set_queue_crypt_options( $queue, %$queue_set );
-    foreach my $ticket_set ( @variants ) {
-        create_a_ticket( $queue, \%mail, $m, %$ticket_set );
-    }
+foreach my $ticket_set (@variants) {
+    create_a_ticket( $queue, \%mail, $m, %$ticket_set );
 }
 
 my $tid;
@@ -57,22 +45,18 @@ my $tid;
 }
 
 # again for each combination add a reply message
-foreach my $queue_set ( @variants ) {
-    set_queue_crypt_options( $queue, %$queue_set );
-    foreach my $ticket_set ( @variants ) {
-        update_ticket( $tid, \%mail, $m, %$ticket_set );
-    }
+foreach my $ticket_set (@variants) {
+    update_ticket( $tid, \%mail, $m, %$ticket_set );
 }
 
-
 # ------------------------------------------------------------------------------
 # now delete all keys from the keyring and put back secret/pub pair for rt-test@
 # and only public key for rt-recipient@ so we can verify signatures and decrypt
 # like we are on another side recieve emails
 # ------------------------------------------------------------------------------
 
-unlink $_ foreach glob( RT->Config->Get('GnuPGOptions')->{'homedir'} ."/*" );
-RT::Test->import_gnupg_key('rt-recipient at example.com', 'public');
+unlink $_ foreach glob( RT->Config->Get('GnuPGOptions')->{'homedir'} . "/*" );
+RT::Test->import_gnupg_key( 'rt-recipient at example.com', 'public' );
 RT::Test->import_gnupg_key('rt-test at example.com');
 
 $queue = RT::Test->load_or_create_queue(
diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing-signed.t
similarity index 67%
copy from t/mail/gnupg-outgoing.t
copy to t/mail/gnupg-outgoing-signed.t
index 400bb4a..626a73b 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing-signed.t
@@ -3,46 +3,35 @@ use strict;
 use warnings;
 
 use RT::Test::GnuPG
-  tests         => 389,
+  tests         => 101,
   gnupg_options => {
     passphrase    => 'rt-test',
     'trust-model' => 'always',
   };
 
 RT::Test->import_gnupg_key('rt-recipient at example.com');
-RT::Test->import_gnupg_key('rt-test at example.com', 'public');
+RT::Test->import_gnupg_key( 'rt-test at example.com', 'public' );
 
 my $queue = RT::Test->load_or_create_queue(
     Name              => 'Regression',
     CorrespondAddress => 'rt-recipient at example.com',
     CommentAddress    => 'rt-recipient at example.com',
+    Sign              => 1,
 );
 ok $queue && $queue->id, 'loaded or created queue';
 
-my ($baseurl, $m) = RT::Test->started_ok;
+my ( $baseurl, $m ) = RT::Test->started_ok;
 ok $m->login, 'logged in';
 
-my @variants = (
-    {},
-    { Sign => 1 },
-    { Encrypt => 1 },
-    { Sign => 1, Encrypt => 1 },
-);
+my @variants =
+  ( {}, { Sign => 1 }, { Encrypt => 1 }, { Sign => 1, Encrypt => 1 }, );
 
 # collect emails
-my %mail = (
-    plain            => [],
-    signed           => [],
-    encrypted        => [],
-    signed_encrypted => [],
-);
+my %mail;
 
 # create a ticket for each combination
-foreach my $queue_set ( @variants ) {
-    set_queue_crypt_options( $queue, %$queue_set );
-    foreach my $ticket_set ( @variants ) {
-        create_a_ticket( $queue, \%mail, $m, %$ticket_set );
-    }
+foreach my $ticket_set (@variants) {
+    create_a_ticket( $queue, \%mail, $m, %$ticket_set );
 }
 
 my $tid;
@@ -57,22 +46,18 @@ my $tid;
 }
 
 # again for each combination add a reply message
-foreach my $queue_set ( @variants ) {
-    set_queue_crypt_options( $queue, %$queue_set );
-    foreach my $ticket_set ( @variants ) {
-        update_ticket( $tid, \%mail, $m, %$ticket_set );
-    }
+foreach my $ticket_set (@variants) {
+    update_ticket( $tid, \%mail, $m, %$ticket_set );
 }
 
-
 # ------------------------------------------------------------------------------
 # now delete all keys from the keyring and put back secret/pub pair for rt-test@
 # and only public key for rt-recipient@ so we can verify signatures and decrypt
 # like we are on another side recieve emails
 # ------------------------------------------------------------------------------
 
-unlink $_ foreach glob( RT->Config->Get('GnuPGOptions')->{'homedir'} ."/*" );
-RT::Test->import_gnupg_key('rt-recipient at example.com', 'public');
+unlink $_ foreach glob( RT->Config->Get('GnuPGOptions')->{'homedir'} . "/*" );
+RT::Test->import_gnupg_key( 'rt-recipient at example.com', 'public' );
 RT::Test->import_gnupg_key('rt-test at example.com');
 
 $queue = RT::Test->load_or_create_queue(
diff --git a/t/mail/gnupg-outgoing.t b/t/mail/gnupg-outgoing-signed_encrypted.t
similarity index 67%
rename from t/mail/gnupg-outgoing.t
rename to t/mail/gnupg-outgoing-signed_encrypted.t
index 400bb4a..4ca7981 100644
--- a/t/mail/gnupg-outgoing.t
+++ b/t/mail/gnupg-outgoing-signed_encrypted.t
@@ -3,46 +3,36 @@ use strict;
 use warnings;
 
 use RT::Test::GnuPG
-  tests         => 389,
+  tests         => 101,
   gnupg_options => {
     passphrase    => 'rt-test',
     'trust-model' => 'always',
   };
 
 RT::Test->import_gnupg_key('rt-recipient at example.com');
-RT::Test->import_gnupg_key('rt-test at example.com', 'public');
+RT::Test->import_gnupg_key( 'rt-test at example.com', 'public' );
 
 my $queue = RT::Test->load_or_create_queue(
     Name              => 'Regression',
     CorrespondAddress => 'rt-recipient at example.com',
     CommentAddress    => 'rt-recipient at example.com',
+    Sign              => 1,
+    Encrypt           => 1,
 );
 ok $queue && $queue->id, 'loaded or created queue';
 
-my ($baseurl, $m) = RT::Test->started_ok;
+my ( $baseurl, $m ) = RT::Test->started_ok;
 ok $m->login, 'logged in';
 
-my @variants = (
-    {},
-    { Sign => 1 },
-    { Encrypt => 1 },
-    { Sign => 1, Encrypt => 1 },
-);
+my @variants =
+  ( {}, { Sign => 1 }, { Encrypt => 1 }, { Sign => 1, Encrypt => 1 }, );
 
 # collect emails
-my %mail = (
-    plain            => [],
-    signed           => [],
-    encrypted        => [],
-    signed_encrypted => [],
-);
+my %mail;
 
 # create a ticket for each combination
-foreach my $queue_set ( @variants ) {
-    set_queue_crypt_options( $queue, %$queue_set );
-    foreach my $ticket_set ( @variants ) {
-        create_a_ticket( $queue, \%mail, $m, %$ticket_set );
-    }
+foreach my $ticket_set (@variants) {
+    create_a_ticket( $queue, \%mail, $m, %$ticket_set );
 }
 
 my $tid;
@@ -57,22 +47,18 @@ my $tid;
 }
 
 # again for each combination add a reply message
-foreach my $queue_set ( @variants ) {
-    set_queue_crypt_options( $queue, %$queue_set );
-    foreach my $ticket_set ( @variants ) {
-        update_ticket( $tid, \%mail, $m, %$ticket_set );
-    }
+foreach my $ticket_set (@variants) {
+    update_ticket( $tid, \%mail, $m, %$ticket_set );
 }
 
-
 # ------------------------------------------------------------------------------
 # now delete all keys from the keyring and put back secret/pub pair for rt-test@
 # and only public key for rt-recipient@ so we can verify signatures and decrypt
 # like we are on another side recieve emails
 # ------------------------------------------------------------------------------
 
-unlink $_ foreach glob( RT->Config->Get('GnuPGOptions')->{'homedir'} ."/*" );
-RT::Test->import_gnupg_key('rt-recipient at example.com', 'public');
+unlink $_ foreach glob( RT->Config->Get('GnuPGOptions')->{'homedir'} . "/*" );
+RT::Test->import_gnupg_key( 'rt-recipient at example.com', 'public' );
 RT::Test->import_gnupg_key('rt-test at example.com');
 
 $queue = RT::Test->load_or_create_queue(

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


More information about the Rt-commit mailing list