Skip to content

Commit

Permalink
Add explicit test_auth dependencies (#3392)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dbutenhof authored Apr 20, 2023
1 parent c74bd4f commit a2ad6c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/pbench/test/unit/server/auth/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,9 @@ def test_verify_auth_invsig(self, make_logger, pbench_drb_token):
assert user is None

@pytest.mark.parametrize("roles", [["ROLE"], ["ROLE1", "ROLE2"], [], None])
def test_verify_auth_oidc(self, monkeypatch, rsa_keys, make_logger, roles):
def test_verify_auth_oidc(
self, monkeypatch, db_session, rsa_keys, make_logger, roles
):
"""Verify OIDC token offline verification success path"""
client_id = "us"
if roles is None:
Expand All @@ -543,7 +545,9 @@ def test_verify_auth_oidc(self, monkeypatch, rsa_keys, make_logger, roles):
assert user.id == "12345"
assert user.roles == (roles if roles else [])

def test_verify_auth_oidc_user_update(self, monkeypatch, rsa_keys, make_logger):
def test_verify_auth_oidc_user_update(
self, monkeypatch, db_session, rsa_keys, make_logger
):
"""Verify we update our internal user database when we get updated user
payload from the OIDC token for an existing user."""
client_id = "us"
Expand Down

0 comments on commit a2ad6c2

Please sign in to comment.