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

SFDX_IMPROVED_CODE_COVERAGE breaks tests #346

Closed
yippie opened this issue Mar 18, 2020 · 4 comments
Closed

SFDX_IMPROVED_CODE_COVERAGE breaks tests #346

yippie opened this issue Mar 18, 2020 · 4 comments
Labels
area:apex Highlights the apex functional area of the CLI. bug Issue or pull request that identifies or fixes a bug owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team.

Comments

@yippie
Copy link

yippie commented Mar 18, 2020

Summary

Setting export SFDX_IMPROVED_CODE_COVERAGE=true then running unit tests results in error

Steps To Reproduce:

run these commands

  1. export SFDX_IMPROVED_CODE_COVERAGE=true
  2. sfdx force:apex:test:run -d ~/test-results/mic -r junit -w 45 -c -l RunLocalTests

Expected result

Tests to complete and display results

Actual result

Unhandled rejection ERROR_HTTP_431: <h1>Bad Message 431</h1><pre>reason: Request Header Fields Too Large</pre>
    at HttpApi.getError (/usr/local/lib/sfdx/node_modules/jsforce/lib/http-api.js:250:13)
    at /usr/local/lib/sfdx/node_modules/jsforce/lib/http-api.js:95:22
    at tryCallOne (/usr/local/lib/sfdx/node_modules/promise/lib/core.js:37:12)
    at /usr/local/lib/sfdx/node_modules/promise/lib/core.js:123:15
    at flush (/usr/local/lib/sfdx/node_modules/asap/raw.js:50:29)
    at process._tickCallback (internal/process/next_tick.js:61:11)
ERROR running force:apex:test:run:  Cannot read property 'message' of undefined

Additional information

Feel free to attach a screenshot.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.50.0-9030e49cbb linux-x64 node-v10.15.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.7.1 (core)
generator 1.1.2 (core)
salesforcedx 48.5.1 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.5 (core)
├─ salesforcedx-templates 48.6.0 (core)
└─ salesforce-alm 48.7.0 (core)

sfdx-cli 7.50.0 (core)

OS and version:
Kernel Version: Linux c626448367da 4.15.0-1052-aws #54-Ubuntu SMP Tue Oct 1 15:43:26 UTC 2019 x86_64 Linux
Starting container circleci/node:12

@clairebianchi clairebianchi added bug Issue or pull request that identifies or fixes a bug owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. labels Mar 20, 2020
@clairebianchi
Copy link
Collaborator

@yippie, I have asked the team that owns the apex commands to take a look

@yippie
Copy link
Author

yippie commented Oct 14, 2020

Is there any progress here? I am still hitting this issue 6 months later.

I am getting the impression the Salesforce dev tools are not tested on projects bigger than a couple dozen classes.

@RitamAgrawal
Copy link
Member

I suggest running the tests asynchronously with test:run command without any parameters just username.
sfdx force:apex:test:run -u <targetusername>
This will return a corresponding test id in suggestion. To generate the test report, run test:report command with parameters(like -c, -d) as per the requirement.
sfdx force:apex:test:report -i <test id:70xx3000011Yxxx> -u <targetusername> -c

@preddivari preddivari added the area:apex Highlights the apex functional area of the CLI. label Sep 21, 2023
@iowillhoit
Copy link
Contributor

Yea, this is happening because you are hitting api limits. The CLI cannot do anything about this.

Try @RitamAgrawal suggestion or take advantage of Test Suites as Shane mentions here:
#2409 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:apex Highlights the apex functional area of the CLI. bug Issue or pull request that identifies or fixes a bug owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team.
Projects
None yet
Development

No branches or pull requests

5 participants