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

fix: All Apex classes/triggers in the ApexCodeCoverageAggregate table are displayed when the "Show Only Aggregated Code Coverage" setting is checked #370

Merged

Conversation

daphne-sfdc
Copy link
Contributor

What does this PR do?

Populates the "Apex Code Coverage by Class" table in the Apex test results with all Apex classes/triggers listed in the ApexCodeCoverageAggregate Tooling API table when the "Show Only Aggregated Code Coverage" setting is checked.

What issues does this PR fix or reference?

forcedotcom/salesforcedx-vscode#5599, @W-15783639@

Functionality Before

When the "Show Only Aggregated Code Coverage" setting is checked, the "Apex Code Coverage by Class" table in the Apex test results is empty.

=== Apex Code Coverage by Class

Functionality After

When the "Show Only Aggregated Code Coverage" setting is checked, the "Apex Code Coverage by Class" table in the Apex test results is populated with all available Apex classes/triggers listed in the ApexCodeCoverageAggregate Tooling API table.

=== Apex Code Coverage by Class
CLASSES               PERCENT  UNCOVERED LINES
────────────────────  ───────  ───────────────
GeocodingService      100%                    
PagedResult           100%                    
PropertyController    100%                    
SampleDataController  100%                    
FileUtilities         100%   

@daphne-sfdc daphne-sfdc requested a review from peternhale May 23, 2024 21:49
allRecords.push(...result.records);
}

return {
done: true,
totalSize: allRecords.length,
records: allRecords
} as QueryResult<T>;
} as QueryResult<R>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@daphne-sfdc I removed the assertion w/o complaint from elsint or others.

See if the same holds for you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you're right - I removed the assertion and the tests still all pass. The functionality also continues to work as expected. Thanks for catching that!

@daphne-sfdc daphne-sfdc requested a review from peternhale June 4, 2024 19:35
@peternhale peternhale merged commit 602ffbd into main Jun 5, 2024
12 of 14 checks passed
@peternhale peternhale deleted the daphne/W-15783639-show-only-aggregated-code-coverage branch June 5, 2024 15:56
gilgourevitch pushed a commit to gilgourevitch/salesforcedx-apex that referenced this pull request Jun 6, 2024
… are displayed when the "Show Only Aggregated Code Coverage" setting is checked (forcedotcom#370)

* fix: set apexClassIdSet to all Apex classes/triggers in ApexCodeCoverageAggregate if it is empty

* refactor: query ApexCodeCoverageAggregate table only once and use queryAll instead of fetchResults()

* test: update codeCoverage.test.ts to reflect new behavior

* fix: use ApexCodeCoverageAggregateRecord in queryAll + add comments

* refactor: use R instead of T in generics for queryAll()

* test: remove assertion in test file
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