-
Notifications
You must be signed in to change notification settings - Fork 78
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
Getting errors if any unit test fails with force:apex:test:run #210
Comments
@ntotten can you please take a look at this issue |
Hi, is there any way to track the status of this issue? |
Hi ,
|
Looking at the stack trace the problem seems to be related to an issue with the data returned from the server being incomplete when we format it before we print the result. We recently made some updates to that area so I would need to know which versions of the plugins & CLI you are running. @paferpo @PseudoDarwinist can you let me know which version of the CLI you're currently on and which plugins you are running (sfdx plugins --core) ? |
Hi @lcampos I have just tested and still get the same errors, to test it, I have just made an assert to fail to reproduce it and got the same (Unhandled rejection TypeError: packageDirs is not iterable). This is the version I'm using: sfdx-cli/7.47.0 win32-x64 node-v10.15.0 sfdx-cli 7.47.0 (core) This is confusing for developers because Bamboo shows these errors in the build results page and they think it's a problem with sfdx and not with their changes: |
I am still receiving the error .The cli version that i am using is(by running sfdx --version) : sfdx-cli/7.44.0-e77f9c8515 linux-x64 node-v10.15.3 |
@paferpo @PseudoDarwinist we're looking into this and will update this thread once we have a fix for it. |
@lcampos Any update on this? I'm currently getting with sfdx-cli/7.59.0-05e06e37e0 win32-x64 node-v10.15.3 |
Hi @gatormike, as you might've already experienced the apex commands in general have a few issues like this one. We've taken a step back and are currently working on making the apex commands reliable. This means this and the rest of the issues are being considered and addressed. The changes will start getting to you in the next weeks and I'll make sure to update this and the rest of the issues we address. cc @smaddox-sf |
@lcampos FYI I started experiencing this in the last couple of weeks, I was not seeing it a month-ish ago. It appears to be org agnostic once it starts happening.
|
Getting the same thing now with 7.74 as well running |
@lcampos Algo getting a similar error:
The strange thing is that all tests passed successfully and I don't get this error when I run the same command against scratch org with the same codebase. This error occurs only with a packaging org (regular developer org with a namespace) SFDX CLI Version
or SFDX CLI Version |
Hi there, I am facing the same issue:
SFDX CLI Version:
|
Same here. |
Same |
I ran this with
Was not able to reproduce the error. |
Summary
Getting errors if a unit test fails after execution of the command force:apex:test:run:
Unhandled rejection TypeError: packageDirs is not iterable
ERROR running force:apex:test:run: Cannot read property 'message' of undefined
Looks like this is always happening when any unit test fails, not just with some specific test classes.
Steps To Reproduce:
Expected result
Test report output should not throw any error.
Actual result
The output is okay except the Failures section. If there any unit test failure, for instance:
CreationServiceTest.doNotLinkToExistingUserWithSameEmail Fail System.DmlException: SObjectFactory Create failed. State: {"Count":"1","Template":null,"SObjectType":"crm_EmailVerification__c"}, Cause: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “EmailVerificationProcessing� process failed. Give your Salesforce admin these details. An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information.: [] 798 Class.SObjectFactory.create: line 126, column 1 Class.SObjectBuilder.create: line 131, column 1 Class.TestDataFactory.createEmailVerification: line 66, column 1
Then, this is what the last part of the output looks like:
=== Failures
Unhandled rejection TypeError: packageDirs is not iterable
at ApexHumanReporter._findFile (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\test\reporter.js:235:34)
at stacks.forEach.stack (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\test\reporter.js:209:59)
at Array.forEach ()
at Object.format (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\test\reporter.js:204:36)
at Object.get (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\node_modules\heroku-cli-util\lib\table.js:59:19)
at render (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\node_modules\heroku-cli-util\lib\table.js:89:24)
at Proxy.table (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\node_modules\heroku-cli-util\lib\table.js:128:3)
at Logger.table (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\core\logApi.js:532:20)
at ApexHumanReporter.logTable (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\test\reporter.js:80:21)
at ApexHumanReporter.logFailuresTable (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\test\reporter.js:195:18)
at ApexHumanReporter.logTables (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\test\reporter.js:247:14)
at ApexHumanReporter.onFinished (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\test\reporter.js:251:14)
at ApexHumanReporter.onFinished (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\apex\apexTestApi.js:94:22)
at ApexHumanReporter.emit (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\test\reporter.js:136:34)
at org.getConfig.then.then.then.then.then.then.then (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\dist\lib\apex\apexTestApi.js:809:38)
at tryCatcher (C:\Program Files\Salesforce CLI\client\node_modules\salesforce-alm\node_modules\bluebird\js\release\util.js:16:23)
ERROR running force:apex:test:run: Cannot read property 'message' of undefined
Additional information
SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.28.7 win32-x64 node-v10.15.3
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.1 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.8 (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.5 (core)
analytics 1.2.1 (core)
apexlink 0.4.2
gearset-sfdx-plugins 0.5.0
generator 1.1.1 (core)
salesforcedx 47.1.5 (core)
├─ force-language-services 47.5.0 (core)
└─ salesforce-alm 47.4.0 (core)
sfdx-cli 7.28.7 (core)
OS and version: Windows 10 Enterprise version 1903 (OS Build 18362.418)
The text was updated successfully, but these errors were encountered: