> For the complete documentation index, see [llms.txt](https://docs.specsolutions.eu/specsync/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.specsolutions.eu/specsync/reference/configuration/configuration-publishtestresults.md).

# publishTestResults

This configuration section contains settings related to publishing test results.

To read more about publishing test results see the [Publishing test result files](/specsync/features/test-result-publishing-features/publishing-test-result-files.md) page. Please also check the [command line reference](/specsync/reference/command-line-reference/publish-test-results-command.md) 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",    
    "testConfiguration": {
      "name": "Windows 10"
    },
    "testRunSettings": {
      "name": "Acceptance test results"
    },
    "testResultSettings": {
      "comment": "BDD results"
    }
  },
  ...
}
```

## 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="/pages/-LVwFCLeorEnzo6Ig_mJ#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](/specsync/reference/command-line-reference/publish-test-results-command.md) |
| `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="/pages/-MDPluWxrIS038G7OS2t#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 Test Suite 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`                                                                                                        |
| `includeNotExecutedTests`           | Includes test results that are not executed (outcomes `NotExecuted`, `NotApplicable`, `NotRunnable`, `NotImpacted`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | `false`                                                                                                        |
| `testConfiguration`                 | <p>Specifies a test configuration within the Azure DevOps project as a target configuration for publishing test results.</p><ul><li><code>testConfiguration/name</code> — The name of the test configuration.</li><li><code>testConfiguration/id</code> — The ID of the test configuration.</li></ul><p>Can be overridden using with a <a href="/pages/-MDFPcq9g5mlpjUQB6d_">command line option</a>.</p>                                                                                                                                                                                                                                                                                                                                                                     | uses the single Test Configuration assigned to the Test Suite                                                  |
| `testSuite`                         | Specifies a test suite within the Azure DevOps project to publish the test results for.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | test cases are not included to a test suite                                                                    |
| `testSuite/name`                    | The name of the Test Suite. For suites with non-unique names, please use the `testSuite/id` or `testSuite/path` setting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | either `name`, `id` or `path` is mandatory                                                                     |
| `testSuite/id`                      | The ID of the Test Suite as a number.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | either `name`, `id` or `path` is mandatory                                                                     |
| `testSuite/path`                    | The path of the Test Suite from the root of the Test Plan, separated by `/` (e.g. `Ordering/Card Payment`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | either `name`, `id` or `path` is mandatory                                                                     |
| `testSuite/testPlan`                | The name or ID of the Test Plan to search or create the test suite in, e.g. `My Plan` or `#1234`. (Optional, improves performance)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | not specified                                                                                                  |
| `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> — The name of the created Test Run. (Default: \[load from test result file])</li><li><code>testRunSettings/comment</code> — The comment of the created Test Run. (Default: empty)</li><li><code>testRunSettings/runType</code> —Sets the run type of the created Test Run. Possible values: <code>manual</code>, <code>automated</code>. (Default: set to <code>automated</code> when <a href="/pages/-LVwFCLoQGc9rq9lS-yF"><code>synchronization/automation/enabled</code></a> is <code>true</code>)</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> — The comment added to the individual test results within the created Test Run. (Default: empty)</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) |
| `{testrun-id}`                    | The ID of the created Test Run                                                                  |
| `{testrun-url}`                   | The URL of the created Test Run                                                                 |

{% content-ref url="/pages/-LVwFCLiKB3ACJLwVZGP" %}
[Configuration reference](/specsync/reference/configuration.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MDFPcq9g5mlpjUQB6d\_" %}
[publish-test-results](/specsync/reference/command-line-reference/publish-test-results-command.md)
{% endcontent-ref %}
