forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
494 stars 78 forks source link

codecoverage not getting #2873

Closed revanth-svmx closed 5 months ago

revanth-svmx commented 5 months ago

Note Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
  • You've searched both open and closed issues for related posts.
  • You've used the doctor command to diagnose common issues.
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.

Summary

sf apex get test --test-run-id 707RL00000E6OMq -o test-kysllsvmthwu@example.com --code-coverage --json Getting this error: RangeError: Invalid string length

Steps To Reproduce

IMPORTANT Provide a repository that's configured to reproduce the issue. If you are unable to provide a repo, please explain why not. The more info we have from the start, the faster we can resolve your issue. We may close your issue if you don't include proper instructions.

  • Generate a project with sf project generate or fork dreamhouse-lwc.
  • Provide detailed step-by-step instructions on how to reproduce the issue.

Expected result

Actual result

System Information

@salesforce/cli/2.41.8 darwin-x64 node-v20.12.2 sarigarevanth@SREVANTH2ML ~ % sf version --verbose --json { "architecture": "darwin-x64", "cliVersion": "@salesforce/cli/2.41.8", "nodeVersion": "node-v20.12.2", "osVersion": "Darwin 22.4.0", "rootPath": "/usr/local/lib/sf", "shell": "zsh", "pluginVersions": [ "@oclif/plugin-autocomplete 3.0.17 (core)", "@oclif/plugin-commands 3.3.2 (core)", "@oclif/plugin-help 6.0.21 (core)", "@oclif/plugin-not-found 3.1.8 (core)", "@oclif/plugin-plugins 5.0.19 (core)", "@oclif/plugin-search 1.0.23 (core)", "@oclif/plugin-update 4.2.11 (core)", "@oclif/plugin-version 2.0.18 (core)", "@oclif/plugin-warn-if-update-available 3.0.16 (core)", "@oclif/plugin-which 3.1.9 (core)", "@salesforce/cli 2.41.8 (core)", "apex 3.1.11 (core)", "auth 3.6.9 (core)", "data 3.3.4 (core)", "deploy-retrieve 3.6.13 (core)", "info 3.2.7 (core)", "limits 3.3.5 (core)", "marketplace 1.2.5 (core)", "org 4.1.8 (core)", "packaging 2.4.2 (core)", "schema 3.3.6 (core)", "settings 2.2.6 (core)", "sobject 1.4.1 (core)", "source 3.3.9 (core)", "telemetry 3.3.5 (core)", "templates 56.2.5 (core)", "trust 3.6.8 (core)", "user 3.5.5 (core)" ] }

PASTE_VERSION_OUTPUT_HERE

Additional information

github-actions[bot] commented 5 months ago

Hello @revanth-svmx :wave: It looks like you didn't include the full Salesforce CLI version information in your issue. Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

Thank you!

github-actions[bot] commented 5 months ago

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.

revanth-svmx commented 5 months ago

@salesforce/cli/2.41.8 darwin-x64 node-v20.12.2

iowillhoit commented 5 months ago

Hello @revanth-svmx,

revanth-svmx commented 5 months ago

sarigarevanth@SREVANTH2ML ~ % sf version --verbose --json { "architecture": "darwin-x64", "cliVersion": "@salesforce/cli/2.41.8", "nodeVersion": "node-v20.12.2", "osVersion": "Darwin 22.4.0", "rootPath": "/usr/local/lib/sf", "shell": "zsh", "pluginVersions": [ "@oclif/plugin-autocomplete 3.0.17 (core)", "@oclif/plugin-commands 3.3.2 (core)", "@oclif/plugin-help 6.0.21 (core)", "@oclif/plugin-not-found 3.1.8 (core)", "@oclif/plugin-plugins 5.0.19 (core)", "@oclif/plugin-search 1.0.23 (core)", "@oclif/plugin-update 4.2.11 (core)", "@oclif/plugin-version 2.0.18 (core)", "@oclif/plugin-warn-if-update-available 3.0.16 (core)", "@oclif/plugin-which 3.1.9 (core)", "@salesforce/cli 2.41.8 (core)", "apex 3.1.11 (core)", "auth 3.6.9 (core)", "data 3.3.4 (core)", "deploy-retrieve 3.6.13 (core)", "info 3.2.7 (core)", "limits 3.3.5 (core)", "marketplace 1.2.5 (core)", "org 4.1.8 (core)", "packaging 2.4.2 (core)", "schema 3.3.6 (core)", "settings 2.2.6 (core)", "sobject 1.4.1 (core)", "source 3.3.9 (core)", "telemetry 3.3.5 (core)", "templates 56.2.5 (core)", "trust 3.6.8 (core)", "user 3.5.5 (core)" ] }

revanth-svmx commented 5 months ago

Hello @revanth-svmx,

[15:59:51.428] DEBUG (sf:connection): request method: "GET" url: "https://fun-ability-3956-dev-ed.scratch.my.salesforce.com/services/data/v60.0/tooling/query/0r8xx2yUm7hIPecAEG-10000" headers: { "content-type": "application/json", "user-agent": "sfdx toolbelt:" } [16:00:20.765] DEBUG (sf:connection): request method: "GET" url: "https://fun-ability-3956-dev-ed.scratch.my.salesforce.com/services/data/v60.0/tooling/query/0r8xx2yUm7hIPecAEG-12000" headers: { "content-type": "application/json", "user-agent": "sfdx toolbelt:" }

  • How many tests are you running? The error indicates that the returned string was too long. I found an internal ticket (W-14848875) that indicates that this should have been fixed in CLI version 2.35.6

2934 classes

iowillhoit commented 5 months ago

I am not seeing the RangeError: Invalid string length error in the debug logs. Is this happening intermittently on the same test-run-id?

Could you try running sf apex get test --test-run-id 707RL00000E6OMq -o test-kysllsvmthwu@example.com --code-coverage --result-format json? (difference is --result-format json vs just --json)

Typically when we see "too many tests" issues, we recommend running sf apex test run with either the --tests or --suite-names to reduce the number. You could then call get run on those results individually.

iowillhoit commented 5 months ago

Apparently the fix I mentioned in my first comment, was intended for use with the -d, --output-dir=<value> flag. Try setting an output directory along with the --result-format json flag and see if that helps

github-actions[bot] commented 5 months ago

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.