# uip tm report

> `uip tm report` produces a structured summary of a completed test execution: counts, pass rate, duration, and every failed test case with the assertion message that explains the failure. Use it when you want a human-scannable dashboard line, or a machine-readable verdict for a CI script.

`uip tm report` produces a structured summary of a completed test execution: counts, pass rate, duration, and every failed test case with the assertion message that explains the failure. Use it when you want a human-scannable dashboard line, or a machine-readable verdict for a CI script.

## Synopsis

```
uip tm report get --execution-id <uuid> (--project-key <key> | --test-set-key <key>) [--query <expr>]
```

All verbs honor the [global options](./global-options.md) and the standard [exit codes](./exit-codes.md). Every verb accepts `-t, --tenant <name>` and `--log-level <level>` (default `Information`).

## uip tm report get

Get a summary for a completed test execution. The command:

1. Fetches the execution's stats (`passed`, `failed`, `none`, `duration`, timing).
2. Pages through the failed test case logs.
3. For each failed log without an `info` string, fetches its assertions and concatenates the messages of the failed ones.
4. Returns one JSON envelope with the summary plus a `FailedTests` list keyed by test case name.

The command exits `0` whenever it successfully produces the summary, whether the run passed or failed. Turning "failed tests present" into a non-zero CI exit is the caller's job (branch on `.Data.Failed`). See [Exit-code behavior on `executions`](./uip-test-manager-executions.md#exit-codes) for the recommended three-step pipeline.

### Arguments

None.

### Options

- `--execution-id <uuid>` *(required)* — execution to summarize. Get this from `uip tm testsets run` output.
- `--project-key <key>` — owning project. Either this or `--test-set-key` is required.
- `--test-set-key <key>` — test set key (e.g. `DEMO:42`); the project key is derived from the prefix.
- `--query <expr>` — jq-style filter applied to the `Data` payload. When set, prints the raw filtered value instead of the JSON envelope. Supports field access (`.Field`) and object construction (`{key: .Field}`).

### Examples

```bash
# simplest
uip tm report get --execution-id a1b2c3d4-0000-0000-0000-000000000001 --project-key DEMO

# scripting-friendly — pick a subset
uip tm report get \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --query '{total: .TotalTests, passed: .Passed, failed: .Failed}'
```

**Data shape** (default output):

```json
{
  "Code": "ReportGet",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "TestSetName": "Smoke Suite",
    "TotalTests": 10,
    "Passed": 8,
    "Failed": 2,
    "Skipped": 0,
    "PassRate": "80%",
    "Duration": "00:02:15",
    "FailedTests": [
      { "TestCaseName": "Login flow", "Error": "Selector not found" },
      { "TestCaseName": "Logout flow", "Error": "Timeout" }
    ]
  }
}
```

Fields:

- `TotalTests` — `Passed + Failed + Skipped`.
- `PassRate` — formatted as a percentage string (`"80%"`).
- `Duration` — formatted `HH:MM:SS`.
- `FailedTests[].Error` — the test case log's `info` field if present; otherwise a `; `-joined list of failed assertion messages; otherwise an empty string.
- `StartTime` / `EndTime` — ISO-8601 timestamps from the execution stats (present in the JSON but elided in the sample above).

## Related

- [testsets run](./uip-test-manager-testsets.md#uip-tm-testsets-run) — produces the `ExecutionId` consumed here.
- [wait](./uip-test-manager-wait.md) — block until the execution is in a terminal state before asking for a summary.
- [result](./uip-test-manager-result.md) — same data as a JUnit XML file.
- [executions testcaselogs list](./uip-test-manager-executions.md#uip-tm-executions-testcaselogs-list) — full enumeration of logs (not only failures).
- [testcaselogs list-assertions](./uip-test-manager-testcases.md#uip-tm-testcaselogs-list-assertions) — examine a single failed log.

## See also

- [Test Manager overview](./uip-test-manager.md)
- [Scripting patterns](./scripting-patterns.md)
- [Output formats](./output-formats.md) — how `--output-filter` and `--query` relate.
