From 9cd91e497c732d870abe856ea2c8b6f5b480dc39 Mon Sep 17 00:00:00 2001 From: Eric <31023784+eecsliu@users.noreply.github.com> Date: Tue, 7 Feb 2023 16:43:23 -0800 Subject: [PATCH] fix: tensorboard list not showing tensorboards [DET-8904] (#669) [e2e_tests changes only] --- e2e_tests/tests/cluster/test_rbac_ntsc.py | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/e2e_tests/tests/cluster/test_rbac_ntsc.py b/e2e_tests/tests/cluster/test_rbac_ntsc.py index f0c65e514e24..b8760335f4e5 100644 --- a/e2e_tests/tests/cluster/test_rbac_ntsc.py +++ b/e2e_tests/tests/cluster/test_rbac_ntsc.py @@ -486,3 +486,44 @@ def get_proxy(creds: authentication.Credentials, task_id: str) -> Optional[error # kill the ntsc kill_ntsc(determined_test_session(creds[0]), typ, created_id) + + +@pytest.mark.e2e_cpu_rbac +@pytest.mark.skipif(rbac_disabled(), reason="ee rbac is required for this test") +def test_tsb_listed() -> None: + with create_workspaces_with_users( + [ + [ + (0, ["Editor"]), + (1, ["Viewer"]), + ], + ] + ) as ([workspace], creds): + pid = bindings.post_PostProject( + determined_test_session(creds[0]), + body=bindings.v1PostProjectRequest(name="test", workspaceId=workspace.id), + workspaceId=workspace.id, + ).project.id + + session = determined_test_session(creds[0]) + + with logged_in_user(creds[0]): + # experiment for tensorboard + experiment_id = exp.create_experiment( + conf.fixtures_path("no_op/single.yaml"), + conf.fixtures_path("no_op"), + ["--project_id", str(pid)], + ) + + created_id = launch_ntsc(session, workspace.id, "tensorboard", experiment_id) + + # list tensorboards and make sure it's included in the response. + tsbs = bindings.get_GetTensorboards(session, workspaceId=workspace.id).tensorboards + assert len(tsbs) == 1, "should be one tensorboard" + assert tsbs[0].id == created_id, "should be the tensorboard we created" + + tsbs = bindings.get_GetTensorboards( + determined_test_session(credentials=creds[1]), workspaceId=workspace.id + ).tensorboards + assert len(tsbs) == 1, "should be one tensorboard" + assert tsbs[0].id == created_id, "should be the tensorboard we created"