Moar fixes (#3829)
This commit is contained in:
parent
38b90ef523
commit
fcb89f42c3
|
|
@ -72,16 +72,22 @@ async function api(options) {
|
|||
apiOptions,
|
||||
spinner
|
||||
);
|
||||
spinner.succeed(`Got test result with id ${testId}`);
|
||||
if (result.status === 'completed') {
|
||||
spinner.succeed(`Got test result with id ${testId}`);
|
||||
|
||||
if (options.api.json) {
|
||||
console.log(JSON.stringify(result));
|
||||
} else {
|
||||
console.log(result.result);
|
||||
if (options.api.json) {
|
||||
console.log(JSON.stringify(result));
|
||||
} else {
|
||||
console.log(result.result);
|
||||
}
|
||||
} else if (result.status === 'failed') {
|
||||
spinner.fail('Test failed');
|
||||
process.exitCode = 1;
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
spinner.fail(error.message);
|
||||
spinner.fail(error.toString());
|
||||
process.exitCode = 1;
|
||||
process.exit();
|
||||
}
|
||||
|
|
@ -112,7 +118,6 @@ async function start() {
|
|||
if (options.api && options.api.hostname) {
|
||||
api(options);
|
||||
} else {
|
||||
process.exitCode = 1;
|
||||
try {
|
||||
const result = await run(options);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ export async function waitAndGetResult(testId, hostname, options, spinner) {
|
|||
spinner.text = response.message;
|
||||
if (response.status === 'completed') {
|
||||
return response;
|
||||
} else if (response.status === 'failed') {
|
||||
return response;
|
||||
}
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
} while (true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue