Skip to content

Commit

Permalink
fix lint errors (#22662)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkorikSergey authored Nov 8, 2023
1 parent c527b61 commit 018710d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/e2e/specs/web-terminal/WebTerminalTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,21 @@ suite(`Login to Openshift console and start WebTerminal ${BASE_TEST_CONSTANTS.TE
await ocpMainPage.openWebTerminal();
});

test('Check username is correct', async function (): Promise<void> {
const userUid = shellExecutor.executeCommand('oc get user $(oc whoami) -o jsonpath={.metadata.uid}').replace(/\n/g, '');
test('Check username is correct', function (): void {
const userUid: string = shellExecutor.executeCommand('oc get user $(oc whoami) -o jsonpath={.metadata.uid}').replace(/\n/g, '');

// label selector for Web Terminal workspaces owned by the currently-logged in user
const labelSelector = 'console.openshift.io/terminal=true,controller.devfile.io/creator=' + userUid;
const labelSelector: string = 'console.openshift.io/terminal=true,controller.devfile.io/creator=' + userUid;
// namespace of this users web terminal
const namespace = shellExecutor.executeCommand(`oc get dw -A -l ${labelSelector} -o jsonpath='{.items[0].metadata.namespace}'`);
const namespace: string = shellExecutor.executeCommand(
`oc get dw -A -l ${labelSelector} -o jsonpath='{.items[0].metadata.namespace}'`
);
// devWorkspace ID for this users web terminal
const termDwId = shellExecutor.executeCommand(`oc get dw -A -l ${labelSelector} -o jsonpath='{.items[0].status.devworkspaceId}'`);
const termDwId: string = shellExecutor.executeCommand(
`oc get dw -A -l ${labelSelector} -o jsonpath='{.items[0].status.devworkspaceId}'`
);
// use oc exec to run oc whoami inside this user's terminal
const user = shellExecutor
const user: string = shellExecutor
.executeCommand(`oc exec -n ${namespace} deploy/${termDwId} -c web-terminal-tooling -- oc whoami`)
.replace(/\n/g, '');
// above should output current user's username:
Expand Down

0 comments on commit 018710d

Please sign in to comment.