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

Missing classes in coverage report generated from sfdx force:apex:test:run #303

Closed
patrykacc opened this issue Aug 19, 2022 · 15 comments
Closed
Labels
bug Something isn't working

Comments

@patrykacc
Copy link

patrykacc commented Aug 19, 2022

Recently I started observing issues related to code coverage report generation. Sometimes whole classes are not listed in report, so our SonarClourd Quality gate fails, even though class is covered with tests properly. When class is not listed in report, then also its not listed in list of classes that were executed.

Steps To Reproduce:

Attached in file (in comment)

Expected result

Class is listed as executed in tests, and coverage report is created

Actual result

Class is NOT listed as executed in tests, and coverage report is NOT created

System Information

Version is listed in attachment

@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@patrykacc
Copy link
Author

patrykacc commented Aug 19, 2022

Attachment
coverage_issue.txt

@mdonnalley mdonnalley added the bug Something isn't working label Aug 19, 2022
@git2gus
Copy link

git2gus bot commented Aug 19, 2022

This issue has been linked to a new work item: W-11622957

@github-actions
Copy link

We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on.

@0ptaq0
Copy link

0ptaq0 commented Sep 2, 2022

I am having the same issue. When running 1000+ unit tests, there are missing classes in the coverage report.
Previously, when the same issue occurred I increased maxQueryLimits
sfdx config:set maxQueryLimit=1600000 --global
but it doesn't help anymore.

@pgajek2
Copy link

pgajek2 commented Sep 2, 2022

The same here. :/

@gbockus-sf gbockus-sf transferred this issue from forcedotcom/cli Sep 26, 2022
@0ptaq0
Copy link

0ptaq0 commented Nov 3, 2022

Any plans to address that ongoing issue?

@janeksledziewski
Copy link

Real pain for big enterprises and long-term projects

@klewis-sfdc
Copy link
Contributor

Salesforce CLI version 7.159 included a version bump of the apex-node library from v0.13 --> v1.1.

In version 1.1, the apex-node library was upgraded to use more recent versions of salesforce/core and jsforce.

The upgrading of core and jsforce seem to have impacted the way the maxQueryLimit is applied when retrieving test report results.

As @0ptaq0 mentions, before cli version 7.159, increasing the maxQueryLimit to 1600000 (something higher than the 10k default value) would return all of the covered classes in the coverage report.

After 7.159, increasing the maxQueryLimit has no effect, and a test run of many hundreds of files that would produce a coverage file nearing 1M lines instead produces a truncated coverage file that omits some of the covered classes.

I have updated the bug WI that was created earlier on this thread with this info.

@patrykacc
Copy link
Author

@klewis-sfdc any sights on having this issue fixed?
It's a real issue for us, as we can't measure quality correctly in our code analyzer instances, which affects our customer relations.

@klewis-sfdc
Copy link
Contributor

@AnanyaJha do you have any insight re: position of this work in the backlog and timing?

@AnanyaJha
Copy link
Contributor

Hi @klewis-sfdc and all! This item has been pulled into Trust work for this iteration. We'll likely get this out to y'all by end of March, but will keep you updated along the way. Thanks for the patience!

@patrykacc
Copy link
Author

Hi guys, do we have any progress in resolving this issue?

@RitamAgrawal
Copy link
Member

We are working on it and will keep you updated.

@daphne-sfdc
Copy link
Contributor

@patrykacc @0ptaq0 @pgajek2 @janeksledziewski

Hello! Our team has some good news for you. This issue has been fixed in #338 and it is now available in the latest version of the CLI v2.22.7. Please update your CLI version to v2.22.7 - you should now be able to see all Apex classes and code coverage results for your test runs. Thank you all for your patience, and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants