-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: add JSON result to test:run command #101
Conversation
@@ -431,13 +437,14 @@ export class TestService { | |||
str = str.slice(0, -1); | |||
|
|||
const perTestCodeCovQuery = | |||
'SELECT ApexTestClassId, ApexClassOrTrigger.Id, ApexClassOrTrigger.Name, TestMethodName, NumLinesCovered, NumLinesUncovered FROM ApexCodeCoverage WHERE ApexTestClassId IN (%s)'; | |||
'SELECT ApexTestClassId, ApexClassOrTrigger.Id, ApexClassOrTrigger.Name, TestMethodName, NumLinesCovered, NumLinesUncovered, Coverage FROM ApexCodeCoverage WHERE ApexTestClassId IN (%s)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLI json result expects Coverage info for each ApexCodeCoverage record
@@ -397,10 +399,13 @@ export type ApexCodeCoverage = { | |||
|
|||
export type PerTestCoverage = { | |||
apexClassOrTriggerName: string; | |||
apexClassorTriggerId: string; | |||
apexClassOrTriggerId: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: capitalizing the Or to be consistent
@@ -241,6 +246,57 @@ describe('force:apex:test:run', () => { | |||
expect(result).to.not.contain('Apex Code Coverage by Class'); | |||
}); | |||
|
|||
test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a test with failed & skipped data results
}; | ||
}; | ||
|
||
export class JsonReporter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need unit tests for this or do we think the ones that execute the oclif command are good enough ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some more tests!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this PR do?
This PR adds formatting to return the correct JSON result. Added more info to the library result so we can use it for this new JSON result
What issues does this PR fix or reference?
@W-8320712@