Skip to content

sfdx force:apex:test:run fails when run from Github action #306

@leighgreen-access

Description

@leighgreen-access

Summary

When we run sfdx force:apex:test:run from our ci/cd Github action, it fails with the error "ERROR running force:apex:test:run: Always provide a classes, suites, tests, or testLevel property."

Steps To Reproduce:

Repository to reproduce: dreamhouse-lwc

We are using code based on the scratch-org-test job of ci-pr.yml in the dreamhouse repo.

  1. Install Salesforce CLI
  2. Checkout the source code
  3. Store secret for dev hub
  4. Authenticate dev hub
  5. Create scratch org
  6. Deploy source to scratch org
  7. Assign permissionset
  8. SKIPPED Import sample data
  9. Run Apex tests in scratch org

Expected result

Test suite is run

Actual result

Error - "ERROR running force:apex:test:run: Always provide a classes, suites, tests, or testLevel property."

We have tried adding a -l RunAllTestsInOrg switch (also tried RunLocalTests, and using --testlevel) and still get the same error.

System Information

Output after installing the sfdx-cli -
sfdx-cli/7.144.2 linux-x64 node-v16.14.2

This was previously working with v7.143.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions