Skip to content

Commit

Permalink
test: debug auth [TESTENG-95] (determined-ai#9942)
Browse files Browse the repository at this point in the history
  • Loading branch information
JComins000 authored Sep 17, 2024
1 parent 13db674 commit a73c8db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webui/react/src/e2e/fixtures/api.workspace.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,19 @@ export class ApiWorkspaceFixture {
* strict superset of the Response, so no info is lost.
*/
async createWorkspace(req: V1PostWorkspaceRequest): Promise<V1PostWorkspaceResponse> {
const apiAuth = this.apiAuth;
const workspaceResp = await (await this.startWorkspaceRequest())
.postWorkspace(req, {})
.catch(async function (error) {
const respBody = await streamConsumers.text(error.body);
if (error.status === 401) {
const token = apiAuth.getBearerToken();
throw new Error(
`Create Workspace Request failed. Status: ${error.status} Request: ${JSON.stringify(
req,
)} Token: ${token} Response: ${respBody}`,
);
}
throw new Error(
`Create Workspace Request failed. Status: ${error.status} Request: ${JSON.stringify(
req,
Expand Down

0 comments on commit a73c8db

Please sign in to comment.