---
title: "TRX"
description: "The run as a Visual Studio test-results file — for Azure DevOps, Visual Studio and VS Code"
url: "https://docs.justcat.it/reference/outputs/trx/"
---
# TRX


## When to use it

On Azure DevOps, when the results should appear on the pipeline's *Tests* tab with the charts and the per-test detail — the *Publish Test Results* task reads `.trx` natively (`testResultsFormat: VSTest`). Also when someone opens results in Visual Studio or VS Code. Outside the Microsoft tooling the format is rarely read; use [JUnit](https://docs.justcat.it/reference/outputs/junit/ "JUnit") there. Like JUnit it carries result and message, not the full definition.

## How to set it

```yaml
Output: trx
```

writes `TestResults/cat-test-results-{timestamp}.trx`. In a pipeline, a fixed name or a wildcard in the publish step:


**Properties**



Format
: trx

File
: TestResults/cat-results.trx





**YAML**


```yaml
Output:
- Format: trx
  File: TestResults/cat-results.trx
```




See [Settings](https://docs.justcat.it/reference/outputs/settings/ "Settings"). Not available on the Starter and Professional plans (MS Excel only). The Azure DevOps steps are in [Integrations](https://docs.justcat.it/how-to-guides/pipelines-and-schedulers/cat-in-azure-devops-pipelines/ "Azure DevOps").

## What it looks like

The [sample run](https://docs.justcat.it/reference/outputs/overview/#the-sample-run "The sample run") — the results section and the summary; the `TestDefinitions`, `TestEntries` and `TestLists` sections that the schema requires are left out here:

```xml
<TestRun id="3aa327e9-c934-4f29-a6cc-b6d69389bbaf" name="build@build-agent-01 2026-08-21 09:06:37" runUser="build-agent-01\build" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <Times creation="2026-08-21T09:06:37.4369592+00:00" queuing="2026-08-21T09:06:37.4369592+00:00" start="2026-08-21T09:06:37.4369592+00:00" finish="2026-08-21T09:06:44.7333889+00:00" />
  <Results>
    <UnitTestResult executionId="2ecab40f-…" testId="aa6f2ccd-…" testName="[Smoke tests].[Airline dimension matches the source]" computerName="build-agent-01" duration="00:00:00.0755756" startTime="2026-08-21T09:06:38.2510955+00:00" endTime="2026-08-21T09:06:38.3266711+00:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="49c5253e-…" relativeResultsDirectory="2ecab40f-…" />
    <UnitTestResult executionId="2ecab40f-…" testId="a1a02f1a-…" testName="[Data quality].[No booking without a passenger]" computerName="build-agent-01" duration="00:00:00.1389169" startTime="2026-08-21T09:06:38.3346170+00:00" endTime="2026-08-21T09:06:38.4735339+00:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="49c5253e-…" relativeResultsDirectory="2ecab40f-…">
      <Output>
        <ErrorInfo>
          <Message>No row was expected, but at least 1 row exists.
MaximumErrorsLogged setting is set to 1. To see more data in the error message, set it to value between 2 and 50.
If the logs should not contain any data, set MaximumErrorsLogged to 0.

┌──────────┬────────┐
│BookingId │Airline │
╞══════════╪════════╡
│BK-1001   │CSA     │
└──────────┴────────┘

CAT did NOT scan the entire set. There may be additional rows.


Description: A booking must reference an existing passenger.
First Data Source: DWH
First Query:

SELECT &amp;#39;BK-1001&amp;#39; AS BookingId, &amp;#39;CSA&amp;#39; AS Airline UNION ALL SELECT &amp;#39;BK-1002&amp;#39;, &amp;#39;LH&amp;#39;

</Message>
          <StackTrace></StackTrace>
        </ErrorInfo>
      </Output>
    </UnitTestResult>
    <UnitTestResult executionId="2ecab40f-…" testId="6c267cc3-…" testName="[Smoke tests].[Flights table is loaded]" computerName="build-agent-01" duration="00:00:06.2492205" startTime="2026-08-21T09:06:38.4778644+00:00" endTime="2026-08-21T09:06:44.7270849+00:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="49c5253e-…" relativeResultsDirectory="2ecab40f-…">
      <Output>
        <ErrorInfo>
          <Message>Error when executing the test: Invalid object name &amp;#39;dbo.Flights&amp;#39;.

Description: 
First Data Source: DWH
First Query:

SELECT * FROM dbo.Flights

</Message>
          <StackTrace></StackTrace>
        </ErrorInfo>
      </Output>
    </UnitTestResult>
  </Results>
  …
  <ResultSummary outcome="Failed">
    <Counters total="3" executed="3" passed="1" failed="1" error="1" timeout="0" aborted="0" inconclusive="0" … />
  </ResultSummary>
</TestRun>
```

## Details

**Structure.** The Visual Studio `TestRun` schema: `Times` of the run, one `UnitTestResult` per test under `Results` (name = the test's [full name](https://docs.justcat.it/reference/tests/properties/#full-name "Full name"), `duration`, `startTime`, `endTime`, `outcome`), then `TestDefinitions`, `TestEntries` and `TestLists` the schema needs, and `ResultSummary` with the counters. `computerName` is the machine that ran the test; `runUser` the account.

**Result mapping.**

| Result | `outcome` | Message |
|---|---|---|
| `Passed` | `Passed` | none |
| `Failed` | `Failed` | `ErrorInfo/Message`: the complete message |
| `Error` | `Failed` | `ErrorInfo/Message`: `Error when executing the test: …` plus description and queries |
| `Inconclusive` | `Failed` | `ErrorInfo/Message`: the reason |

The schema's `outcome` has no slot CAT maps `Error` and `Inconclusive` to, so both come out `Failed`; the message tells them apart, and `ResultSummary` still counts `error` separately. The message text is HTML-encoded once more inside the XML (`&amp;#39;` for an apostrophe), which the readers undo.

**Written once, after the run.** The *Publish Test Results* task publishes whatever the file says; set *Fail if there are test failures* on the task when a failed test should fail the pipeline.

## Related

* [JUnit](https://docs.justcat.it/reference/outputs/junit/ "JUnit") — the format every other CI platform reads.
* [Azure DevOps](https://docs.justcat.it/how-to-guides/pipelines-and-schedulers/cat-in-azure-devops-pipelines/ "Azure DevOps") — the pipeline, step by step.

