Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated the code to handle null outpuT #894

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions TestResultSummaryService/parsers/Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ class Test extends Parser {
}

async parse(output) {
if (!output) {
return {
tests: [
{
testName: 'Pre Test',
testOutput: '',
testResult: 'FAILED',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The strings 'Pre Test' and 'FAILED' (+ 'Post Test' and 'PASSED') are used at several places in this file. With this new addition it would be great of we can create constants for that strings.

testData: null
}
],
type: 'Test'
};
}

const tests = await this.extract(output);
const { javaVersion, jdkDate, sdkResource } =
this.exactJavaVersion(output);
Expand Down
Loading