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

Apex test command throws vague error if no tests are found #3217

Open
zenibako opened this issue Feb 15, 2025 · 2 comments
Open

Apex test command throws vague error if no tests are found #3217

zenibako opened this issue Feb 15, 2025 · 2 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@zenibako
Copy link

Expected result

Running sf apex run test --synchronous -c should pass and not exit the shell.

Actual result

Running sf apex run test --synchronous -c throws the below error and exits the shell with code 1:

Error (1): Always provide a classes, suites, tests, or testLevel property.

Additional information

This is easy to recreate with a fresh project (sf project generate) and scratch org (sf org create scratch --set-default --definition-file config/project-scratch-def.json).

System Information

CLI:
@salesforce/cli/2.76.7 darwin-arm64 node-v22.13.1

Plugin Version:
@oclif/plugin-autocomplete 3.2.20 (core)
@oclif/plugin-commands 4.1.19 (core)
@oclif/plugin-help 6.2.24 (core)
@oclif/plugin-not-found 3.2.40 (core)
@oclif/plugin-plugins 5.4.30 (core)
@oclif/plugin-search 1.2.20 (core)
@oclif/plugin-update 4.6.30 (core)
@oclif/plugin-version 2.2.23 (core)
@oclif/plugin-warn-if-update-available 3.1.32 (core)
@oclif/plugin-which 3.2.28 (core)
@salesforce/cli 2.76.7 (core)
apex 3.6.8 (core)
api 1.3.3 (core)
auth 3.6.92 (core)
code-analyzer 5.0.0-beta.1 (user)
data 4.0.9 (core)
deploy-retrieve 3.18.0 (core)
dev 2.5.1 (user)
info 3.4.37 (core)
limits 3.3.45 (core)
marketplace 1.3.7 (core)
org 5.2.29 (core)
packaging 2.9.16 (core)
schema 3.3.49 (core)
settings 2.4.14 (core)
sobject 1.4.50 (core)
telemetry 3.6.32 (core)
templates 56.3.37 (core)
trust 3.7.61 (core)
user 3.6.8 (core)
@salesforce/sfdx-scanner 4.9.0 (user)
deployment-validator 1.0.1 (link) /Users/chandleranderson/Projects/training-lab-plugin
SF ENV. VARS.
SF_USE_GENERIC_UNIX_KEYCHAIN,true
SF_BINPATH,/Users/chandleranderson/.local/share/sf/client/bin/sf
SF_BETA_TRACK_FILE_MOVES,true
SF_AC_ZSH_SETUP_PATH,/Users/chandleranderson/Library/Caches/sf/autocomplete/zsh_setup
SF_AUTOUPDATE_DISABLE,true
SF_DISABLE_AUTOUPDATE,true
SF_UPDATE_INSTRUCTIONS,Use "npm update --global @salesforce/cli" to update npm-based installations.
Windows: false
Shell: zsh
Channel: stable

Diagnostics

✅ pass - salesforcedx plugin isn’t installed
❌ fail - you have at least one linked plugin
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org/
✅ pass - using latest or latest-rc CLI version
✅ pass - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion
✅ pass - [@salesforce/plugin-deploy-retrieve] default target DevHub max apiVersion matches default target org max apiVersion
❌ warn - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches default target org max apiVersion
✅ pass - can access: https://test.salesforce.com
✅ pass - can access: https://appexchange.salesforce.com/services/data
✅ pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
❌ fail - [@salesforce/plugin-auth] CLI supports v2 crypto
✅ pass - [@salesforce/plugin-auth] CLI using stable v1 crypto

@cristiand391
Copy link
Member

fyi @shetzel: the error msg comes from the server:
forcedotcom/salesforcedx-apex#306 (comment)

@shetzel shetzel added the bug Issue or pull request that identifies or fixes a bug label Feb 19, 2025
Copy link

git2gus bot commented Feb 19, 2025

This issue has been linked to a new work item: W-17866064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants