mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-29 09:10:58 +01:00
Initialize auth stores in shard-order-sensitive internal/api tests
TestEstablishSAMLSession panicked when refreshed internal/api shard weights placed it in api-3 before any test initialized the package-level session and CSRF stores (run 46133585552, job 140948795581). Initialize and restore the test auth stores via useSAMLTestAuthStores(t) in TestEstablishSAMLSession and newHostedAuthzTestRouter so both suites remain self-contained regardless of shard cut boundaries. Contract-Neutral: Test-only initialization fix for existing internal/api unit tests; no production behavior or subsystem contract changes. Change-source: pulse-maintainer
This commit is contained in:
@@ -14,6 +14,8 @@ import (
|
||||
)
|
||||
|
||||
func newHostedAuthzTestRouter(t *testing.T) *Router {
|
||||
t.Helper()
|
||||
useSAMLTestAuthStores(t)
|
||||
baseDir := t.TempDir()
|
||||
|
||||
hashed, err := internalauth.HashPassword("Password!1")
|
||||
|
||||
@@ -94,6 +94,8 @@ func TestHandleSAMLLogout_Fallback(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestEstablishSAMLSession(t *testing.T) {
|
||||
useSAMLTestAuthStores(t)
|
||||
|
||||
router := &Router{}
|
||||
req := httptest.NewRequest(http.MethodGet, "/", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
|
||||
Reference in New Issue
Block a user