---
schema_version: "1"
id: bb83cc7fb4f14950f53cbd58ecd7b19d648197aaf2cdadae58b0486bd6478d88
title: logic get test (Beta)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/logic/cli_reference_logic_get_test.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_logic_get_test.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 51815ebcd5e81799dd544152f206a0d5eea645a8781fb264340478f7fc2149fd
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# logic get test (Beta)

Get the results of a test run.

**note:** 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](https://www.salesforce.com/company/legal/agreements/).

## Description for logic get test

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.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;api&#8209;version</code> | N/A | **Type:** Value<br><br>Override the api version used for api requests made by this command |
| <code>&#8209;&#8209;code&#8209;coverage</code> | <code>&#8209;c</code> | **Type:** Boolean<br><br>Retrieve code coverage results. |
| <code>&#8209;&#8209;concise</code> | N/A | **Type:** Boolean<br><br>Display only failed test results; works with human-readable output only. |
| <code>&#8209;&#8209;detailed&#8209;coverage</code> | N/A | **Type:** Boolean<br><br>Display detailed code coverage per test. |
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |
| <code>&#8209;&#8209;output&#8209;dir</code> | <code>&#8209;d</code> | **Type:** Value<br><br>Directory in which to store test result files. |
| <code>&#8209;&#8209;result&#8209;format</code> | <code>&#8209;r</code> | **Type:** Value<br>**Valid Values:** `human`, `tap`, `junit`, `json`<br>**Default value:** `human`<br><br>Format of the test results. |
| <code>&#8209;&#8209;target&#8209;org</code> | <code>&#8209;o</code> | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |
| <code>&#8209;&#8209;test&#8209;run&#8209;id</code> | <code>&#8209;i</code> | **Type:** Value<br>**Required**<br><br>ID of the test run. |

## Examples for logic get test

Get the results for a specific test run ID in the default human-readable format; uses your default org:

```shell
sf logic get test --test-run-id <test run id>
```

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":

```shell
sf logic get test --test-run-id <test run id> --result-format junit --target-org my-scratch
```
<!-- prettier-ignore-end -->
