[Rt-commit] rt branch, 4.4/externalauth-tests, created. rt-4.4.0-268-gaa88fe1

Alex Vandiver alexmv at bestpractical.com
Sat Jul 2 07:06:44 EDT 2016


The branch, 4.4/externalauth-tests has been created
        at  aa88fe1a7a8655f286a48d5fa827de7fea4870db (commit)

- Log -----------------------------------------------------------------
commit aa88fe1a7a8655f286a48d5fa827de7fea4870db
Author: Alex Vandiver <alex at chmrr.net>
Date:   Sat Jul 2 03:33:34 2016 -0700

    In tests, call PostLoadCheck to enable Externalauth
    
    02b06597 made the ExternalAuth meta-setting automatically enabled via
    PostLoadCheck, and 8946b1b8 removed the code in tests that set it.
    Because of the bug fixed in 43c13180, however, the ExternalAuth flag
    was always enabled, making tests pass.
    
    Post-43c13180, the PostLoadCheck is never called after the ->Set calls
    inside a testfile.  As such, the ExternalAuth meta-setting is never
    enabled, and all external auth tests fail.
    
    Explicitly call ->PostLoadCheck after each block of
    ExternalAuth-related ->Set calls, to trigger the activation of the
    ExternalAuth meta-setting.  Calling each configuration's PostLoadCheck
    hook automatically after each ->Set would require careful adjustment
    of the order of ->Set calls, which might be surprising behavior, as
    ordering is not important in `RT_SiteConfig.pm`.

diff --git a/t/externalauth/ldap.t b/t/externalauth/ldap.t
index 34dcf83..ef48411 100644
--- a/t/externalauth/ldap.t
+++ b/t/externalauth/ldap.t
@@ -49,10 +49,7 @@ RT->Config->Set(
         },
     }
 );
-
-# print "sleeping... ";
-# sleep( 500 );
-# print "done\n";
+RT->Config->PostLoadCheck;
 
 my ( $baseurl, $m ) = RT::Test->started_ok();
 
diff --git a/t/externalauth/ldap_escaping.t b/t/externalauth/ldap_escaping.t
index 0442313..34cb2a6 100644
--- a/t/externalauth/ldap_escaping.t
+++ b/t/externalauth/ldap_escaping.t
@@ -72,6 +72,7 @@ RT->Config->Set(
         },
     }
 );
+RT->Config->PostLoadCheck;
 
 my ( $baseurl, $m ) = RT::Test->started_ok();
 
diff --git a/t/externalauth/ldap_group.t b/t/externalauth/ldap_group.t
index a3d87a8..ebeea97 100644
--- a/t/externalauth/ldap_group.t
+++ b/t/externalauth/ldap_group.t
@@ -55,7 +55,6 @@ $ldap->add(
     ],
 );
 
-#RT->Config->Set( Plugins                     => 'RT::Authen::ExternalAuth' );
 RT->Config->Set( ExternalAuthPriority        => ['My_LDAP'] );
 RT->Config->Set( ExternalInfoPriority        => ['My_LDAP'] );
 RT->Config->Set( AutoCreateNonExternalUsers  => 0 );
@@ -80,6 +79,7 @@ RT->Config->Set(
         },
     }
 );
+RT->Config->PostLoadCheck;
 
 my ( $baseurl, $m ) = RT::Test->started_ok();
 
diff --git a/t/externalauth/ldap_privileged.t b/t/externalauth/ldap_privileged.t
index fe5e05a..7acdcc5 100644
--- a/t/externalauth/ldap_privileged.t
+++ b/t/externalauth/ldap_privileged.t
@@ -47,6 +47,7 @@ RT->Config->Set(
         },
     }
 );
+RT->Config->PostLoadCheck;
 
 my ( $baseurl, $m ) = RT::Test->started_ok();
 
diff --git a/t/externalauth/sessions.t b/t/externalauth/sessions.t
index 9b3ec36..bb9416c 100644
--- a/t/externalauth/sessions.t
+++ b/t/externalauth/sessions.t
@@ -117,5 +117,6 @@ sub setup_auth_source {
             },
         }
     );
+    RT->Config->PostLoadCheck;
 }
 
diff --git a/t/externalauth/sqlite.t b/t/externalauth/sqlite.t
index 9e7c2cc..489aaef 100644
--- a/t/externalauth/sqlite.t
+++ b/t/externalauth/sqlite.t
@@ -56,6 +56,7 @@ RT->Config->Set(
         },
     }
 );
+RT->Config->PostLoadCheck;
 
 my ( $baseurl, $m ) = RT::Test->started_ok();
 

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


More information about the rt-commit mailing list