forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
947 stars 404 forks source link

Unable to run force:apex:test:run ansynchronously in 7.97.1 #3164

Closed jajimenezffdc closed 3 years ago

jajimenezffdc commented 3 years ago

Summary

Moving from sfdx-cli/7.75.0 to 7.97.1

Steps To Reproduce:

Repository to reproduce: dreamhouse-lwc

  1. sfdx force:org:create -f config/project-scratch-def.json -w 30 -d 1 --json
  2. sfdx force:source:push -f -u test-xxxxxxxxx@example.com
  3. sfdx force:apex:test:run -u test-xxxxxxxxx@example.com --testlevel RunLocalTests --json

Expected result

Both 7.75 and 7.97 should start running async and return a json with the following format: { "status": 0, "result": { "testRunId": "7072D00000mqC65" } }

Actual result

When running on 7.97.1 it waits until the tests have finished, and then return the detailed output: { "status": 0, "result": { "summary": { ..... }, "tests": [ ..... ] }

Additional information

Also tested on 7.96.1 with the same result

SFDX CLI Version(to find the version of the CLI engine run sfdx --version): sfdx-cli/7.97.1 linux-x64 node-v14.15.4

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core) salesforcedx 51.8.0

OS and version: MacOs

github-actions[bot] commented 3 years 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.

AnanyaJha commented 3 years ago

Hi @jajimenezffdc thanks for reporting this! I can confirm that the command is still running asynchronously by default, but it seems like the issue you're seeing is related to the output. If I'm understanding correctly, when the --json flag or result format is specified, the command is now waiting for the test run to finish and then display the full result rather than just displaying the test run id related info first?

jajimenezffdc commented 3 years ago

Thanks @AnanyaJha . That's correct. We are using the --json flag and expecting to have in the output the "testRunId", but getting the full summary instead.

jajimenezffdc commented 3 years ago

Any update on this issue or expected release to fix it? @AnanyaJha Thanks.

AnanyaJha commented 3 years ago

Hi @jajimenezffdc thanks for checking in! We're working on a fix and expect it to be released within the next few (~3) weeks.

ncrebbincertinia commented 3 years ago

@AnanyaJha I see there is a merged PR for this is the fix available?

AnanyaJha commented 3 years ago

Hi @jajimenezffdc & @ncrebbinffdc thanks for checking in! A fix for this has been released with the latest version of the Apex plugin - please update your plugin to version 0.2.4 by running sfdx plugins:install apex@0.2.4 to test it out. Let us know if things look good!

jajimenezffdc commented 3 years ago

Thanks @AnanyaJha. Will this be included in the next cli release? I've tried sfdx-cli/7.113.0 (last version at this point), and still need to manually update to apex@0.2.4. By the way, upgrading the version seems to work as expected after my first tests. Thanks for fixing it.

randi274 commented 3 years ago

@jajimenezffdc we actually had another issue opened where this behavior is being noted with the latest CLI version (7.114.0), so CLI has picked up these changes now. Since this is working for you now, we'll go ahead and close this one out!