Skip to content

Commit

Permalink
chore: fix a missing check for global permissions in jq (#874)
Browse files Browse the repository at this point in the history
we had missed a check for global permissions when determining

[e2e_tests changes only]
  • Loading branch information
hamidzr authored and rb-determined-ai committed Oct 10, 2023
1 parent 72a2d06 commit 28da71b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions e2e_tests/tests/cluster/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ def logged_in_user(credentials: authentication.Credentials) -> Generator:
log_out_user()


@pytest.mark.e2e_cpu
def test_logged_in_user() -> None:
with logged_in_user(ADMIN_CREDENTIALS):
output = det_run(["user", "whoami"])
assert f"You are logged in as user '{ADMIN_CREDENTIALS.username}'" in output


def get_random_string() -> str:
return str(uuid.uuid4())

Expand Down
15 changes: 14 additions & 1 deletion e2e_tests/tests/job/test_rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from tests import api_utils
from tests import experiment as exp
from tests.cluster.test_rbac import create_workspaces_with_users, rbac_disabled
from tests.cluster.test_users import ADMIN_CREDENTIALS, logged_in_user
from tests.cluster.test_users import ADMIN_CREDENTIALS, det_run, logged_in_user


def seed_workspace(ws: bindings.v1Workspace) -> None:
Expand All @@ -33,6 +33,19 @@ def seed_workspace(ws: bindings.v1Workspace) -> None:
api_utils.launch_ntsc(admin_session, workspace_id=ws.id, typ=ntsc, exp_id=experiment_id)


@pytest.mark.e2e_cpu_rbac
@pytest.mark.skipif(rbac_disabled(), reason="ee rbac is required for this test")
def test_job_global_perm() -> None:
with logged_in_user(ADMIN_CREDENTIALS):
experiment_id = exp.create_experiment(
conf.fixtures_path("no_op/single.yaml"),
conf.fixtures_path("no_op"),
["--project_id", str(1)],
)
output = det_run(["job", "ls"])
assert str(experiment_id) in str(output)


@pytest.mark.e2e_cpu_rbac
@pytest.mark.skipif(rbac_disabled(), reason="ee rbac is required for this test")
def test_job_filtering() -> None:
Expand Down

0 comments on commit 28da71b

Please sign in to comment.