[Rt-commit] r12852 - in rt/branches/3.8-TESTING: . t t/ticket t/web
alexmv at bestpractical.com
alexmv at bestpractical.com
Tue Jun 3 15:32:15 EDT 2008
Author: alexmv
Date: Tue Jun 3 15:32:14 2008
New Revision: 12852
Modified:
rt/branches/3.8-TESTING/ (props changed)
rt/branches/3.8-TESTING/lib/RT/Test.pm
rt/branches/3.8-TESTING/t/00-compile.t
rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-multiple.t
rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-single.t
rt/branches/3.8-TESTING/t/ticket/sort-by-queue.t
rt/branches/3.8-TESTING/t/ticket/sort-by-user.t
rt/branches/3.8-TESTING/t/web/basic.t
rt/branches/3.8-TESTING/t/web/gnupg-outgoing.t
rt/branches/3.8-TESTING/t/web/gnupg-select-keys-on-create.t
rt/branches/3.8-TESTING/t/web/gnupg-select-keys-on-update.t
rt/branches/3.8-TESTING/t/web/ticket_owner.t
rt/branches/3.8-TESTING/t/web/ticket_seen.t
Log:
r32459 at kohr-ah: chmrr | 2008-06-03 15:31:52 -0400
* Quiet 'diag's unless we're running inver TEST_VERBOSE
* Don't warn on opening an empty testing mailbox
Modified: rt/branches/3.8-TESTING/lib/RT/Test.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Test.pm (original)
+++ rt/branches/3.8-TESTING/lib/RT/Test.pm Tue Jun 3 15:32:14 2008
@@ -508,7 +508,7 @@
sub fetch_caught_mails {
my $self = shift;
return grep /\S/, split /%% split me! %%/,
- RT::Test->file_content( 't/mailbox', 'unlink' => 1 );
+ RT::Test->file_content( 't/mailbox', 'unlink' => 1, noexist => 1 );
}
sub file_content {
@@ -521,7 +521,7 @@
diag "reading content of '$path'" if $ENV{'TEST_VERBOSE'};
open my $fh, "<:raw", $path
- or do { warn "couldn't open file '$path': $!"; return '' };
+ or do { warn "couldn't open file '$path': $!" unless $args{noexist}; return '' };
my $content = do { local $/; <$fh> };
close $fh;
Modified: rt/branches/3.8-TESTING/t/00-compile.t
==============================================================================
--- rt/branches/3.8-TESTING/t/00-compile.t (original)
+++ rt/branches/3.8-TESTING/t/00-compile.t Tue Jun 3 15:32:14 2008
@@ -53,7 +53,6 @@
for (@files) {
local $SIG{__WARN__} = sub {};
require_ok($_);
- diag $_;
}
1;
Modified: rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-multiple.t
==============================================================================
--- rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-multiple.t (original)
+++ rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-multiple.t Tue Jun 3 15:32:14 2008
@@ -12,7 +12,7 @@
# Test Sorting by custom fields.
-diag "Create a queue to test with.";
+diag "Create a queue to test with." if $ENV{TEST_VERBOSE};
my $queue_name = "CFSortQueue-$$";
my $queue;
{
@@ -24,7 +24,7 @@
ok($ret, "$queue_name - test queue creation. $msg");
}
-diag "create a CF\n";
+diag "create a CF\n" if $ENV{TEST_VERBOSE};
my $cf_name = "Order$$";
my $cf;
{
Modified: rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-single.t
==============================================================================
--- rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-single.t (original)
+++ rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-single.t Tue Jun 3 15:32:14 2008
@@ -12,7 +12,7 @@
# Test Sorting by FreeformSingle custom field.
-diag "Create a queue to test with.";
+diag "Create a queue to test with." if $ENV{TEST_VERBOSE};
my $queue_name = "CFSortQueue-$$";
my $queue;
{
@@ -28,7 +28,7 @@
my %CF;
my $cf_name;
-diag "create a CF\n";
+diag "create a CF\n" if $ENV{TEST_VERBOSE};
{
$cf_name = $CF{'CF'}{'name'} = "Order$$";
$CF{'CF'}{'obj'} = RT::CustomField->new( $RT::SystemUser );
@@ -160,7 +160,7 @@
-diag "create another CF\n";
+diag "create another CF\n" if $ENV{TEST_VERBOSE};
{
$CF{'AnotherCF'}{'name'} = "OrderAnother$$";
$CF{'AnotherCF'}{'obj'} = RT::CustomField->new( $RT::SystemUser );
Modified: rt/branches/3.8-TESTING/t/ticket/sort-by-queue.t
==============================================================================
--- rt/branches/3.8-TESTING/t/ticket/sort-by-queue.t (original)
+++ rt/branches/3.8-TESTING/t/ticket/sort-by-queue.t Tue Jun 3 15:32:14 2008
@@ -15,7 +15,7 @@
#########################################################
-diag "Create queues to test with.";
+diag "Create queues to test with." if $ENV{TEST_VERBOSE};
my @qids;
my @queues;
# create them in reverse order to avoid false positives
Modified: rt/branches/3.8-TESTING/t/ticket/sort-by-user.t
==============================================================================
--- rt/branches/3.8-TESTING/t/ticket/sort-by-user.t (original)
+++ rt/branches/3.8-TESTING/t/ticket/sort-by-user.t Tue Jun 3 15:32:14 2008
@@ -15,7 +15,7 @@
# we sort by user name
#########################################################
-diag "Create a queue to test with.";
+diag "Create a queue to test with." if $ENV{TEST_VERBOSE};
my $queue_name = "OwnerSortQueue$$";
my $queue;
{
Modified: rt/branches/3.8-TESTING/t/web/basic.t
==============================================================================
--- rt/branches/3.8-TESTING/t/web/basic.t (original)
+++ rt/branches/3.8-TESTING/t/web/basic.t Tue Jun 3 15:32:14 2008
@@ -13,7 +13,7 @@
# get the top page
my $url = $agent->rt_base_url;
-diag $url;
+diag $url if $ENV{TEST_VERBOSE};
$agent->get($url);
is ($agent->{'status'}, 200, "Loaded a page");
Modified: rt/branches/3.8-TESTING/t/web/gnupg-outgoing.t
==============================================================================
--- rt/branches/3.8-TESTING/t/web/gnupg-outgoing.t (original)
+++ rt/branches/3.8-TESTING/t/web/gnupg-outgoing.t Tue Jun 3 15:32:14 2008
@@ -68,7 +68,7 @@
signed_encrypted => [],
);
-diag "check in read-only mode that queue's props influence create/update ticket pages";
+diag "check in read-only mode that queue's props influence create/update ticket pages" if $ENV{TEST_VERBOSE};
{
foreach my $variant ( @variants ) {
set_queue_crypt_options( %$variant );
Modified: rt/branches/3.8-TESTING/t/web/gnupg-select-keys-on-create.t
==============================================================================
--- rt/branches/3.8-TESTING/t/web/gnupg-select-keys-on-create.t (original)
+++ rt/branches/3.8-TESTING/t/web/gnupg-select-keys-on-create.t Tue Jun 3 15:32:14 2008
@@ -32,7 +32,7 @@
passphrase => 'rt-test',
'no-permission-warning' => undef,
);
-diag "GnuPG --homedir ". RT->Config->Get('GnuPGOptions')->{'homedir'};
+diag "GnuPG --homedir ". RT->Config->Get('GnuPGOptions')->{'homedir'} if $ENV{TEST_VERBOSE};
RT->Config->Set( 'MailPlugins' => 'Auth::MailFrom', 'Auth::GnuPG' );
@@ -51,7 +51,7 @@
my ($baseurl, $m) = RT::Test->started_ok;
ok $m->login, 'logged in';
-diag "check that signing doesn't work if there is no key";
+diag "check that signing doesn't work if there is no key" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
@@ -77,7 +77,7 @@
is $res{'info'}[0]{'TrustTerse'}, 'ultimate', 'ultimately trusted key';
}
-diag "check that things don't work if there is no key";
+diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
@@ -103,7 +103,7 @@
ok !@mail, 'there are no outgoing emails';
}
-diag "import first key of rt-test\@example.com";
+diag "import first key of rt-test\@example.com" if $ENV{TEST_VERBOSE};
my $fpr1 = '';
{
RT::Test->import_gnupg_key('rt-test at example.com', 'public');
@@ -112,7 +112,7 @@
$fpr1 = $res{'info'}[0]{'Fingerprint'};
}
-diag "check that things still doesn't work if key is not trusted";
+diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
@@ -150,7 +150,7 @@
ok !@mail, 'there are no outgoing emails';
}
-diag "import a second key of rt-test\@example.com";
+diag "import a second key of rt-test\@example.com" if $ENV{TEST_VERBOSE};
my $fpr2 = '';
{
RT::Test->import_gnupg_key('rt-test at example.com.2', 'public');
@@ -159,7 +159,7 @@
$fpr2 = $res{'info'}[2]{'Fingerprint'};
}
-diag "check that things still doesn't work if two keys are not trusted";
+diag "check that things still doesn't work if two keys are not trusted" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
Modified: rt/branches/3.8-TESTING/t/web/gnupg-select-keys-on-update.t
==============================================================================
--- rt/branches/3.8-TESTING/t/web/gnupg-select-keys-on-update.t (original)
+++ rt/branches/3.8-TESTING/t/web/gnupg-select-keys-on-update.t Tue Jun 3 15:32:14 2008
@@ -32,7 +32,7 @@
passphrase => 'rt-test',
'no-permission-warning' => undef,
);
-diag "GnuPG --homedir ". RT->Config->Get('GnuPGOptions')->{'homedir'};
+diag "GnuPG --homedir ". RT->Config->Get('GnuPGOptions')->{'homedir'} if $ENV{TEST_VERBOSE};
RT->Config->Set( 'MailPlugins' => 'Auth::MailFrom', 'Auth::GnuPG' );
@@ -62,7 +62,7 @@
ok $tid, 'ticket created';
}
-diag "check that signing doesn't work if there is no key";
+diag "check that signing doesn't work if there is no key" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
@@ -89,7 +89,7 @@
is $res{'info'}[0]{'TrustTerse'}, 'ultimate', 'ultimately trusted key';
}
-diag "check that things don't work if there is no key";
+diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
@@ -117,7 +117,7 @@
}
-diag "import first key of rt-test\@example.com";
+diag "import first key of rt-test\@example.com" if $ENV{TEST_VERBOSE};
my $fpr1 = '';
{
RT::Test->import_gnupg_key('rt-test at example.com', 'public');
@@ -126,7 +126,7 @@
$fpr1 = $res{'info'}[0]{'Fingerprint'};
}
-diag "check that things still doesn't work if key is not trusted";
+diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
@@ -165,7 +165,7 @@
ok !@mail, 'there are no outgoing emails';
}
-diag "import a second key of rt-test\@example.com";
+diag "import a second key of rt-test\@example.com" if $ENV{TEST_VERBOSE};
my $fpr2 = '';
{
RT::Test->import_gnupg_key('rt-test at example.com.2', 'public');
@@ -174,7 +174,7 @@
$fpr2 = $res{'info'}[2]{'Fingerprint'};
}
-diag "check that things still doesn't work if two keys are not trusted";
+diag "check that things still doesn't work if two keys are not trusted" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
@@ -220,7 +220,7 @@
is $res{'info'}[1]{'TrustLevel'}, 0, 'is not trusted key';
}
-diag "check that we see key selector even if only one key is trusted but there are more keys";
+diag "check that we see key selector even if only one key is trusted but there are more keys" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
@@ -248,7 +248,7 @@
ok !@mail, 'there are no outgoing emails';
}
-diag "check that key selector works and we can select trusted key";
+diag "check that key selector works and we can select trusted key" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
@@ -281,7 +281,7 @@
check_text_emails( { Encrypt => 1 }, @mail );
}
-diag "check encrypting of attachments";
+diag "check encrypting of attachments" if $ENV{TEST_VERBOSE};
{
unlink "t/mailbox";
Modified: rt/branches/3.8-TESTING/t/web/ticket_owner.t
==============================================================================
--- rt/branches/3.8-TESTING/t/web/ticket_owner.t (original)
+++ rt/branches/3.8-TESTING/t/web/ticket_owner.t Tue Jun 3 15:32:14 2008
@@ -29,7 +29,7 @@
my $agent_a = RT::Test::Web->new;
ok $agent_a->login('user_a', 'password'), 'logged in as user A';
-diag "current user has no right to own, nobody selected as owner on create";
+diag "current user has no right to own, nobody selected as owner on create" if $ENV{TEST_VERBOSE};
{
$agent_a->get_ok('/', 'open home page');
$agent_a->form_name('CreateTicketInQueue');
@@ -53,7 +53,7 @@
is $ticket->Owner, $RT::Nobody->id, 'correct owner';
}
-diag "user can chose owner of a new ticket";
+diag "user can chose owner of a new ticket" if $ENV{TEST_VERBOSE};
{
$agent_a->get_ok('/', 'open home page');
$agent_a->form_name('CreateTicketInQueue');
@@ -82,7 +82,7 @@
my $agent_b = RT::Test::Web->new;
ok $agent_b->login('user_b', 'password'), 'logged in as user B';
-diag "user A can not change owner after create";
+diag "user A can not change owner after create" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -115,11 +115,11 @@
};
$test_cb->($agent_a);
-diag "even owner(user B) can not change owner";
+ diag "even owner(user B) can not change owner" if $ENV{TEST_VERBOSE};
$test_cb->($agent_b);
}
-diag "on reply correct owner is selected";
+diag "on reply correct owner is selected" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -148,7 +148,7 @@
{ Principal => $user_b, Right => [qw(SeeQueue ShowTicket OwnTicket)] },
), 'set rights');
-diag "Couldn't take without coresponding right";
+diag "Couldn't take without coresponding right" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -165,7 +165,7 @@
'no Steal link as well';
}
-diag "Couldn't steal without coresponding right";
+diag "Couldn't steal without coresponding right" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -187,7 +187,7 @@
{ Principal => $user_a, Right => [qw(SeeQueue ShowTicket CreateTicket TakeTicket)] },
), 'set rights');
-diag "TakeTicket require OwnTicket to work";
+diag "TakeTicket require OwnTicket to work" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -209,7 +209,7 @@
{ Principal => $user_b, Right => [qw(SeeQueue ShowTicket OwnTicket)] },
), 'set rights');
-diag "TakeTicket+OwnTicket work";
+diag "TakeTicket+OwnTicket work" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -230,7 +230,7 @@
is $ticket->Owner, $user_a->id, 'correct owner';
}
-diag "TakeTicket+OwnTicket don't work when owner is not nobody";
+diag "TakeTicket+OwnTicket don't work when owner is not nobody" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -253,7 +253,7 @@
{ Principal => $user_b, Right => [qw(SeeQueue ShowTicket OwnTicket)] },
), 'set rights');
-diag "StealTicket require OwnTicket to work";
+diag "StealTicket require OwnTicket to work" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -276,7 +276,7 @@
{ Principal => $user_b, Right => [qw(SeeQueue ShowTicket OwnTicket)] },
), 'set rights');
-diag "StealTicket+OwnTicket work";
+diag "StealTicket+OwnTicket work" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -298,7 +298,7 @@
is $ticket->Owner, $user_a->id, 'correct owner';
}
-diag "StealTicket+OwnTicket don't work when owner is nobody";
+diag "StealTicket+OwnTicket don't work when owner is nobody" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -320,7 +320,7 @@
{ Principal => $user_b, Right => [qw(SeeQueue ShowTicket OwnTicket)] },
), 'set rights');
-diag "no Steal link when owner nobody";
+diag "no Steal link when owner nobody" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
@@ -337,7 +337,7 @@
'but have Take link');
}
-diag "no Take link when owner is not nobody";
+diag "no Take link when owner is not nobody" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_a );
my ($id, $txn, $msg) = $ticket->Create(
Modified: rt/branches/3.8-TESTING/t/web/ticket_seen.t
==============================================================================
--- rt/branches/3.8-TESTING/t/web/ticket_seen.t (original)
+++ rt/branches/3.8-TESTING/t/web/ticket_seen.t Tue Jun 3 15:32:14 2008
@@ -31,7 +31,7 @@
my $agent_b = RT::Test::Web->new;
ok $agent_b->login('user_b', 'password'), 'logged in as user B';
-diag "create a ticket for testing";
+diag "create a ticket for testing" if $ENV{TEST_VERBOSE};
my $tid;
{
my $ticket = RT::Ticket->new( $user_a );
@@ -45,7 +45,7 @@
is $ticket->Owner, $user_a->id, 'correct owner';
}
-diag "user B adds a message, we check that user A see notification and can clear it";
+diag "user B adds a message, we check that user A see notification and can clear it" if $ENV{TEST_VERBOSE};
{
my $ticket = RT::Ticket->new( $user_b );
$ticket->Load( $tid );
More information about the Rt-commit
mailing list