-
Notifications
You must be signed in to change notification settings - Fork 406
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 output of "Apex Code Coverage by Class" when "Store Only Aggregated Code Coverage" is enabled in the Test Execution settings #5599
Comments
This issue has been linked to a new work item: W-15783639 |
Hi @amtrack, Thank you for filing this issue. Yes, this is a bug, and I was able to reproduce it in my environment with a large project containing 4000 Apex classes and 4000 Apex test classes and the dreamhouse-lwc sample project. As my team member @peternhale responded to your previous issue, we have work in our backlog for handling large Apex test runs, and we will work on this bug as part of that effort. Thank you for your patience. We'll keep you updated when we have more progress on resolving your issue. |
@daphne-sfdc Just to double-check, this ticket here isn't related to large codebases, it is only related to the Test Execution setting "Store Only Aggregated Code Coverage".
Maybe the |
Hi @amtrack, I spoke to my team today and received confirmation that this is working as designed. I spent some time to study the code and run tests on it in dreamhouse-lwc - thank you for pointing me to the After the Apex test run completes, the results are passed into The Apex classes listed in the "Apex Code Coverage by Class" table are the classes that are covered by the Apex tests in the current test run. That set is identified by the calculation of per class code coverage and cannot be inferred otherwise from the Apex test run. One alternative is to list all Apex classes present in the org in that table, since the "Store Only Aggregated Code Coverage" setting is designed to be used for large test runs, which often refers to all the Apex test classes in a given org. However, that would limit the results from when that setting is checked to only make sense in one use case. Our team does agree that while the feature is working as originally designed, it's not intuitive, and thus we are currently investigating this issue to understand the alternatives for displaying useful information in the "Apex Code Coverage by Class" table. In the meantime, please continue to use your workaround, and we will keep you updated with our findings. Thank you for your patience. |
Hi @amtrack, We have some good news for you - we have a fix for this issue! Now when the "Store Only Aggregated Code Coverage" setting is checked, then all the entries in the ApexCodeCoverageAggregate Tooling API table will be displayed in the Apex test results - more details in the PR linked above. To get this fix into your CLI now, run Please let us know if this works for you and I can close this issue. |
@daphne-sfdc Thank you very much! 🥳 |
@amtrack Thanks for the confirmation, and I'm very happy to hear that we're able to resolve your issue. 😀 Closing this issue as completed. ✅ |
Summary
sf apex run test --code-coverage --wait 10
does not output theApex Code Coverage by Class
when "Store Only Aggregated Code Coverage" is enabled in the Test Execution settings (apexSettings > enableAggregateCodeCoverageOnly > true
).Steps To Reproduce:
Please see this Git repository reproducing this issue using GitHub Actions: https://github.com/mdapi-issues/mre-missing-output-for-aggregated-only-coverage.
To reproduce manually, see the instructions.
Expected result
The output after
=== Apex Code Coverage by Class
should look like:Actual result
The output after
=== Apex Code Coverage by Class
is empty:Additional information
Salesforce Extension Version in VS Code: -
Salesforce CLI Version:
@salesforce/cli/2.41.8 darwin-arm64 node-v20.10.0
OS and version: MacOS Sonoma 14.5
VS Code version: -
Most recent version of the extensions where this was working: -
The text was updated successfully, but these errors were encountered: