Skip to content

Commit

Permalink
In tests, call PostLoadCheck to enable Externalauth
Browse files Browse the repository at this point in the history
02b0659 made the ExternalAuth meta-setting automatically enabled via
PostLoadCheck, and 8946b1b removed the code in tests that set it.
Because of the bug fixed in 43c1318, 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`.
  • Loading branch information
alexmv authored and sartak committed Jul 18, 2016
1 parent db69a36 commit 0bba58c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions t/externalauth/ldap.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ RT->Config->Set(
},
}
);

# print "sleeping... ";
# sleep( 500 );
# print "done\n";
RT->Config->PostLoadCheck;

my ( $baseurl, $m ) = RT::Test->started_ok();

Expand Down
1 change: 1 addition & 0 deletions t/externalauth/ldap_escaping.t
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ RT->Config->Set(
},
}
);
RT->Config->PostLoadCheck;

my ( $baseurl, $m ) = RT::Test->started_ok();

Expand Down
2 changes: 1 addition & 1 deletion t/externalauth/ldap_group.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -80,6 +79,7 @@ RT->Config->Set(
},
}
);
RT->Config->PostLoadCheck;

my ( $baseurl, $m ) = RT::Test->started_ok();

Expand Down
1 change: 1 addition & 0 deletions t/externalauth/ldap_privileged.t
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RT->Config->Set(
},
}
);
RT->Config->PostLoadCheck;

my ( $baseurl, $m ) = RT::Test->started_ok();

Expand Down
1 change: 1 addition & 0 deletions t/externalauth/sessions.t
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@ sub setup_auth_source {
},
}
);
RT->Config->PostLoadCheck;
}

1 change: 1 addition & 0 deletions t/externalauth/sqlite.t
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ RT->Config->Set(
},
}
);
RT->Config->PostLoadCheck;

my ( $baseurl, $m ) = RT::Test->started_ok();

Expand Down

0 comments on commit 0bba58c

Please sign in to comment.