logic get test (Beta)

Get the results of a test run.

This feature is a Beta Service. Customers may opt to try such Beta Service in its sole discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided at Agreements and Terms.

When you run ‘sf logic run test’ to test Apex classes and Flows asynchronously, it returns a test run ID. Use that ID with this command to see the results.

To see code coverage results, use the –code-coverage flag with –result-format. The output displays a high-level summary of the test run and the code coverage values for classes in your org. If you specify human-readable result format, use the –detailed-coverage flag to see detailed coverage results for each test method run.

Flag Name (Long)Flag Name (Short)Description
‑‑api‑versionN/AType: Value

Override the api version used for api requests made by this command
‑‑code‑coverage‑cType: Boolean

Retrieve code coverage results.
‑‑conciseN/AType: Boolean

Display only failed test results; works with human-readable output only.
‑‑detailed‑coverageN/AType: Boolean

Display detailed code coverage per test.
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑output‑dir‑dType: Value

Directory in which to store test result files.
‑‑result‑format‑rType: Value
Valid Values: human, tap, junit, json
Default value: human

Format of the test results.
‑‑target‑org‑oType: Value
Required

Username or alias of the target org. Not required if the target-org configuration variable is already set.
‑‑test‑run‑id‑iType: Value
Required

ID of the test run.

Get the results for a specific test run ID in the default human-readable format; uses your default org:

Get the results for a specific test run ID, format them as JUnit, and save them to the “test-results/junit” directory; uses the org with alias “my-scratch”: