Skip to content

Commit

Permalink
Fix timeout and add execa for server:delete (#1027)
Browse files Browse the repository at this point in the history
Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
  • Loading branch information
flacatus committed Dec 11, 2020
1 parent 91a6204 commit fa906ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions test/e2e/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,14 @@ describe('Workspace creation, list, start, inject, delete. Support stop and dele
})

describe('Delete Eclipse Che server', () => {
test
.stdout({ print: true })
.stderr({ print: true })
.command(['server:delete', '--yes', '--delete-namespace', '-n', `${NAMESPACE}`])
.exit(0)
.it(`deletes Eclipse Che resources on ${PLATFORM} platform successfully`)
it('server:delete command coverage', async () => {
console.log('>>> Testing server:delete command')

const { exitCode, stdout, stderr } = await execa(binChectl, ['server:delete', `-n ${NAMESPACE}`, '--delete-namespace', '--yes'], { shell: true })

console.log(`stdout: ${stdout}`)
console.log(`stderr: ${stderr}`)
expect(exitCode).equal(0)
})
})
})
2 changes: 1 addition & 1 deletion test/e2e/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class E2eHelper {
// async getAllWorkspaces(isOpenshiftPlatformFamily: string): Promise<chetypes.workspace.Workspace[]> {
private async getAllWorkspaces(): Promise<WorkspaceInfo[]> {
const workspaces: WorkspaceInfo[] = []
const { stdout } = await execa(binChectl, ['workspace:list'], { timeout: 10000 })
const { stdout } = await execa(binChectl, ['workspace:list'])
const regEx = new RegExp('[A-Za-z0-9_-]+', 'g')
for (const line of stdout.split('\n')) {
const items = line.match(regEx)
Expand Down

0 comments on commit fa906ce

Please sign in to comment.