# publishTestResults

This configuration section contains settings related to publishing test results.

To read more about publishing test results see the [Publishing test result files](https://docs.specsolutions.eu/specsync/jira/features/test-result-publishing-features/publishing-test-result-files) page. Please also check the [command line reference](https://docs.specsolutions.eu/specsync/jira/reference/command-line-reference/publish-test-results-command) for the `publish-test-results` command.

The following example shows the most common options within this section.

```javascript
{
  ...
  "publishTestResults": {
    "testResult": {
      "sources": [
        {
          "value": "test-result.trx"
        }
      ]
    },
    "treatInconclusiveAs": "Failed",
    "flakyTestOutcome": "lastAttemptOutcome",    
    "testRunSettings": {
      "description": "Acceptance test results",
      "folder": "/BDD"
    },
    "testResultSettings": {
      "environment": "Staging"
    }
  },
  ...
}
```

## Settings

| Setting                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Default                                                                                                                                       |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `testResult`                        | <p>The test result configuration</p><ul><li><code>testResult/sources</code> — An array of test result sources. Each source should specify a <code>value</code> (the path of the test result file or a folder containing multiple test result files) and optionally a <code>baseFolder</code> (the base folder for the test result file, defaults to the folder of the configuration file).</li><li><code>testResult/resultFormat</code> — The format of the test result file. Please check the <a href="../../compatibility#supported-test-result-formats">Compatibility</a> page for supported formats. Invoking the <code>publish-test-result</code> command with <code>?</code> as format as command line option will list all supported format as well.</li></ul> | specified as [command line option](https://docs.specsolutions.eu/specsync/jira/reference/command-line-reference/publish-test-results-command) |
| `treatInconclusiveAs`               | Maps the Inconclusive test results. Some test execution frameworks report skipped scenarios as Inconclusive, so they should be mapped to another value, e.g. `NotExecuted`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | not mapped                                                                                                                                    |
| `flakyTestOutcome`                  | <p>Specifies how the overall outcome of flaky tests (tests that were rerun multiple times and at least one attempt failed) should be calculated.</p><ul><li><code>lastAttemptOutcome</code> — Uses the outcome of the last attempt (default behavior)</li><li><code>failed</code> — If any attempt failed, the overall outcome will be Failed, otherwise uses the last attempt outcome</li></ul><p>For more details, see the <a href="../../../features/test-result-publishing-features/publishing-test-result-files#detecting-test-reruns-and-flaky-tests">Detecting test reruns and flaky tests</a> section.</p>                                                                                                                                                    | `LastAttemptOutcome`                                                                                                                          |
| `onTestPointMissing`                | Specifies the behavior for the case when a Test Case result has found, but the Test Case is not included in the target for publishing results. Possible values: `skipTestResult`, `warning`, `error`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | `warning`                                                                                                                                     |
| `publishEmptyResults`               | Publishes test results even if no matching results found.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | `false`                                                                                                                                       |
| `publishAttachmentsForPassingTests` | Controls which attachments should be published for passing tests. Possible values: `none` - no attachments are published for passing tests, `files` - only file attachments are published, `all` - both file attachments and test output are attached. Note: this setting does not affect publishing failing tests, which always publish all attachments.                                                                                                                                                                                                                                                                                                                                                                                                             | `files`                                                                                                                                       |
| `testRunSettings`                   | <p>Specifies additional settings for the created test run. The value can contain <a href="#setting-placeholders">placeholders</a>.</p><ul><li><code>testRunSettings/name</code> — In Zephyr Scale, it sets the Test Cycle name</li><li><code>testRunSettings/description</code> — In Zephyr Scale, it sets the Test Cycle description</li><li><code>testRunSettings/iteration</code> — In Zephyr Scale, it sets the Test Cycle iteration</li><li><code>testRunSettings/folder</code> — In Zephyr Scale, it sets the Test Cycle folder</li><li><code>testRunSettings/version</code> — In Zephyr Scale, it sets the Test Cycle version</li></ul>                                                                                                                        | use default settings                                                                                                                          |
| `testResultSettings`                | <p>Specifies additional settings for the created test results. The value can contain <a href="#setting-placeholders">placeholders</a>.</p><ul><li><code>testResultSettings/comment</code> — In Zephyr Scale, it sets the test result comment</li><li><code>testResultSettings/environment</code> — In Zephyr Scale, it sets the test result environment</li><li><code>testResultSettings/iteration</code> — In Zephyr Scale, it sets the test result iteration</li><li><code>testResultSettings/version</code> — In Zephyr Scale, it sets the test result version</li></ul>                                                                                                                                                                                           | use default settings                                                                                                                          |

## Setting Placeholders <a href="#setting-placeholders" id="setting-placeholders"></a>

| Placeholder                       | Description                                                                                     |
| --------------------------------- | ----------------------------------------------------------------------------------------------- |
| `{br}`                            | a new line                                                                                      |
| `{env:ENVIRONMENT_VARIABLE_NAME}` | The content of the environment variable specified (`ENVIRONMENT_VARIABLE_NAME` in this example) |

{% content-ref url="" %}
[](https://docs.specsolutions.eu/specsync/jira/reference/configuration)
{% endcontent-ref %}

{% content-ref url="../command-line-reference/publish-test-results-command" %}
[publish-test-results-command](https://docs.specsolutions.eu/specsync/jira/reference/command-line-reference/publish-test-results-command)
{% endcontent-ref %}
