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

feat: add JSON result to test:run command #101

Merged
merged 10 commits into from
Dec 2, 2020
Merged

feat: add JSON result to test:run command #101

merged 10 commits into from
Dec 2, 2020

Conversation

AnanyaJha
Copy link
Contributor

@AnanyaJha AnanyaJha commented Dec 1, 2020

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@

@AnanyaJha AnanyaJha requested a review from a team as a code owner December 1, 2020 19:20
@@ -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)';
Copy link
Contributor Author

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;
Copy link
Contributor Author

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

@AnanyaJha AnanyaJha requested a review from lcampos December 1, 2020 19:27
@@ -241,6 +246,57 @@ describe('force:apex:test:run', () => {
expect(result).to.not.contain('Apex Code Coverage by Class');
});

test
Copy link
Contributor

@lcampos lcampos Dec 1, 2020

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 {
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some more tests!

Copy link
Contributor

@lcampos lcampos left a comment

Choose a reason for hiding this comment

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

:shipit:

@AnanyaJha AnanyaJha merged commit c802f1c into develop Dec 2, 2020
@AnanyaJha AnanyaJha deleted the aj/json branch December 2, 2020 03:21
AnanyaJha added a commit that referenced this pull request Dec 2, 2020
AnanyaJha added a commit that referenced this pull request Dec 2, 2020
klewis-sfdc pushed a commit that referenced this pull request Oct 24, 2022
WillieRuemmele pushed a commit that referenced this pull request Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants