Skip to content

Commit

Permalink
Ensure skipped status is set on unittest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Jul 26, 2021
1 parent c25d1a7 commit d48f08c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/client/testing/testController/unittest/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ export class UnittestRunner implements ITestsRunner {
runInstance.appendOutput(text);
counts.passed += 1;
} else if (data.outcome === 'failed') {
const traceback = data.traceback.splitLines({ trim: false, removeEmptyEntries: true }).join('\r\n');
const traceback = data.traceback
? data.traceback.splitLines({ trim: false, removeEmptyEntries: true }).join('\r\n')
: '';
const text = `${rawTestCase.rawId} Failed: ${data.message}\r\n${traceback}\r\n`;
const message = new TestMessage(text);

Expand All @@ -119,7 +121,9 @@ export class UnittestRunner implements ITestsRunner {
stopTesting = true;
}
} else if (data.outcome === 'error') {
const traceback = data.traceback.splitLines({ trim: false, removeEmptyEntries: true }).join('\r\n');
const traceback = data.traceback
? data.traceback.splitLines({ trim: false, removeEmptyEntries: true }).join('\r\n')
: '';
const text = `${rawTestCase.rawId} Failed with Error: ${data.message}\r\n${traceback}\r\n`;
const message = new TestMessage(text);

Expand All @@ -134,7 +138,9 @@ export class UnittestRunner implements ITestsRunner {
stopTesting = true;
}
} else if (data.outcome === 'skipped') {
const traceback = data.traceback.splitLines({ trim: false, removeEmptyEntries: true }).join('\r\n');
const traceback = data.traceback
? data.traceback.splitLines({ trim: false, removeEmptyEntries: true }).join('\r\n')
: '';
const text = `${rawTestCase.rawId} Skipped: ${data.message}\r\n${traceback}\r\n`;
runInstance.skipped(testCase);
runInstance.appendOutput(text);
Expand Down

0 comments on commit d48f08c

Please sign in to comment.