Skip to content

Commit

Permalink
Add explicit test_auth dependencies
Browse files Browse the repository at this point in the history
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 distributed-system-analysis#3381
  • Loading branch information
dbutenhof committed Apr 19, 2023
1 parent c74bd4f commit b0f9e1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 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,7 @@ 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 +543,7 @@ 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 b0f9e1c

Please sign in to comment.