Skip to content

Commit a2ad6c2

Browse files
authored
Add explicit test_auth dependencies (#3392)
* Add explicit test_auth dependencies PBENCH-1130 Several tests in `test_auth.py` implicitly depended on previous DB init; they were failing occasionally in CI parallel test runs when scheduled without the prior setup. Resolves #3381
1 parent c74bd4f commit a2ad6c2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/pbench/test/unit/server/auth/test_auth.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,9 @@ def test_verify_auth_invsig(self, make_logger, pbench_drb_token):
517517
assert user is None
518518

519519
@pytest.mark.parametrize("roles", [["ROLE"], ["ROLE1", "ROLE2"], [], None])
520-
def test_verify_auth_oidc(self, monkeypatch, rsa_keys, make_logger, roles):
520+
def test_verify_auth_oidc(
521+
self, monkeypatch, db_session, rsa_keys, make_logger, roles
522+
):
521523
"""Verify OIDC token offline verification success path"""
522524
client_id = "us"
523525
if roles is None:
@@ -543,7 +545,9 @@ def test_verify_auth_oidc(self, monkeypatch, rsa_keys, make_logger, roles):
543545
assert user.id == "12345"
544546
assert user.roles == (roles if roles else [])
545547

546-
def test_verify_auth_oidc_user_update(self, monkeypatch, rsa_keys, make_logger):
548+
def test_verify_auth_oidc_user_update(
549+
self, monkeypatch, db_session, rsa_keys, make_logger
550+
):
547551
"""Verify we update our internal user database when we get updated user
548552
payload from the OIDC token for an existing user."""
549553
client_id = "us"

0 commit comments

Comments
 (0)