[Rt-commit] rt branch, 4.0/remote-user-warnings, created. rt-4.0.2-187-gf373953

Alex Vandiver alexmv at bestpractical.com
Wed Oct 5 13:56:18 EDT 2011


The branch, 4.0/remote-user-warnings has been created
        at  f373953215b77966ef738184376a53c2354ee250 (commit)

- Log -----------------------------------------------------------------
commit 0884b043572534efa2c57ccb854a4bc1a94cee78
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Oct 5 13:41:13 2011 -0400

    Force warnings on in parallel tests
    
    While 'make test' used prove, which defaulted to enabling warnings in
    all of its tests, 'make parallel-test' did not pass the -w flag, which
    lead to perl's warnings in testfiles being hidden.

diff --git a/Makefile.in b/Makefile.in
index 73744d7..e5231d0 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -352,7 +352,7 @@ test:
 parallel-test: test-parallel
 
 test-parallel: 
-	RT_TEST_PARALLEL=1 $(PERL) "-MApp::Prove" -e 'my $$p = App::Prove->new(); $$p->process_args("-lrj5","--state=slow,save", "t"); $$p->run()'
+	RT_TEST_PARALLEL=1 $(PERL) "-MApp::Prove" -e 'my $$p = App::Prove->new(); $$p->process_args("-wlrj5","--state=slow,save", "t"); $$p->run()'
 
 regression-reset-db: force-dropdb
 	$(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action init --dba-password ''

commit f373953215b77966ef738184376a53c2354ee250
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Oct 5 13:42:17 2011 -0400

    Avoid (client-side) warnings in the ->credentials code
    
    LWP provides no way to entirely remove the credentials for a website,
    merely to set them to empty, which still provides an Authorization
    header, and creates undef warnings.  Thus, rather than use the
    ->credentials API, simply pass our own Authorization header when we want
    it.

diff --git a/t/web/remote_user.t b/t/web/remote_user.t
index 1955113..edad6ef 100644
--- a/t/web/remote_user.t
+++ b/t/web/remote_user.t
@@ -2,30 +2,24 @@ use strict;
 use warnings;
 use RT;
 use RT::Test tests => 9;
+use MIME::Base64 qw//;
 
 RT->Config->Set( DevelMode => 0 );
 RT->Config->Set( WebExternalAuth => 1 );
 
+sub auth {
+    return Authorization => "Basic " .
+        MIME::Base64::encode( join(":", @_) );
+}
+
 my ( $url, $m ) = RT::Test->started_ok( basic_auth => 1 );
 $m->get($url);
-is($m->status, 401, "Initial request wuth no creds gets 401");
-
-my $authority = URI->new($url)->authority;
+is($m->status, 401, "Initial request with no creds gets 401");
 
-$m->credentials(
-    $authority,
-    "restricted area",
-    root => "wrong",
-);
-$m->get($url);
+$m->get($url, auth( root => "wrong" ));
 is($m->status, 401, "Request with wrong creds gets 401");
 
-$m->credentials(
-    $authority,
-    "restricted area",
-    root => "password",
-);
-$m->get($url);
+$m->get($url, auth( root => "password" ));
 is($m->status, 200, "Request with right creds gets 200");
 
 $m->content_like(
@@ -34,18 +28,9 @@ $m->content_like(
 );
 $m->content_unlike(qr/Logout/i, "Has no logout button, no WebFallbackToInternalAuth");
 
-$m->credentials(
-    $authority,
-    "restricted area",
-    undef, undef
-);
 $m->get($url);
 is($m->status, 401, "Subsequent requests without credentials aren't still logged in");
 
 
 # Put the credentials back for the warnings check at the end
-$m->credentials(
-    $authority,
-    "restricted area",
-    root => "password",
-);
+$m->default_header( auth( root => "password" ));

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


More information about the Rt-commit mailing list