question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected change of behavior for sfdx force:apex:test:run --synchronous

See original GitHub issue

sfdx force:apex:test:run --synchronous behaviour

There is an unexpected change of the behaviour of sfdx force:apex:test:run --synchronous, because now returns a new message “Specify a test class or test methods when running tests synchronously”.

Steps To Reproduce:

$ sfdx --version
sfdx-cli/7.96.0 linux-x64 node-v15.14.0 
$ sfdx force:apex:test:run -l RunLocalTests -y -c -r human
ERROR running force:apex:test:run: Specify a test class or test methods when running tests synchronously

Expected result

For us to run all tests synchronously is important for our continuous integration jobs.

Additional information

SFDX CLI Version(to find the version of the CLI engine run sfdx --version): sfdx-cli/7.96.0

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

@oclif/plugin-autocomplete 0.3.0 (core) @oclif/plugin-commands 1.3.0 (core) @oclif/plugin-help 3.2.2 (core) @oclif/plugin-not-found 1.2.4 (core) @oclif/plugin-plugins 1.10.0 (core) @oclif/plugin-update 1.4.0-3 (core) @oclif/plugin-warn-if-update-available 1.7.0 (core) @oclif/plugin-which 1.0.3 (core) @salesforce/sfdx-trust 3.6.0 (core) alias 1.1.9 (core) auth 1.5.1 (core) config 1.2.8 (core) generator 1.1.5 (core) salesforcedx 51.7.1 (core) ├─ data 0.4.3 (core) ├─ apex 0.1.21 (core) ├─ custom-metadata 1.0.11 (core) ├─ limits 1.0.5 (core) ├─ org 1.6.1 (core) ├─ schema 1.0.5 (core) ├─ templates 51.3.0 (core) ├─ user 1.2.8 (core) ├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core) └─ salesforce-alm 51.6.10 (core) sfdx-cli 7.96.0 (core) telemetry 1.1.1 (core)

OS and version: docker alpine: Linux cc246b97cbac 4.19.121-linuxkit forcedotcom/cli#1 SMP Thu Jan 21 15:36:34 UTC 2021 x86_64 Linux

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
smaddox-sfcommented, Apr 19, 2021

Hi @froucher - We will be restoring the prior behavior in the CLI for the near-term. As @AnanyaJha pointed out, the synchronous flag only supports running tests from a single class so the synchronous behavior you’ve been working with might not have been quite what you expected. We will put the CLI behavior back as it was for now and come back to fix this bug at a later date. (When we do that fix, we will add a warning on the command months in advance so you can adjust to the new behavior)

0reactions
rajdanalacommented, Sep 2, 2021

@froucher Are you able to run synchronous tests. Did you find any workaround?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to raise an issue about "sfdx force:apex:test:run
(Yes you can change to --resultformat json but then it is not easy to spot the "StackTrace" output.) If you know of a...
Read more >
Run Apex Tests | Salesforce DX Developer Guide
Use the --synchronous parameter to run tests synchronously. The command waits to display the test results until all tests have completed.
Read more >
Sfdx scripts - Veiled Mirror
May 06, 2020 · Retrieve and deploy using SFDX There are several script options available in ... I run them consistently to sync...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found