Repository navigation
Description
Split out from #1515, based on the comment there of 2026-10-23. #1515 now covers the console output only.
Idea
In agent mode, the adapter writes a result file per test assembly and prints one line with its path, for example NUnit results: <path>. The console stays short. The file carries the data, and the agent reads it only when it needs more.
Original design:
- The file is written by default in agent mode, with failures only. An option writes the full run, including passed tests and durations, for questions such as "why is this flaky or slow?".
- The console line with the path is the important part. Without it, agents rarely find the file.
Why a file
| Aspect | Console output | Result file |
|---|---|---|
| Control over format | Partial. The VSTest logger or MTP draws it. | Full. NUnit owns the schema. |
| Same in VSTest and MTP | No, two different renderers | Yes |
| Mixed with other output | Yes: build output, other loggers, warnings | No |
| Token cost | Paid on every run | Paid only when the agent reads it |
| Short vs detailed | Chosen with settings before the run | One file; the agent selects what it needs (jq) |
What changed since the proposal
The console part of #1515 is implemented and measured. In agent mode the console output for failed tests is already short: the VSTest logger prints each failed test with message, a filtered stack trace and its output, and the adapter sends almost nothing else (56 % to 63 % less output in the repro). So the file is no longer needed for the failures themselves. What it still adds:
- Data about the full run: passed tests, durations, and skip and inconclusive reasons, without putting them on the console.
- The same format in VSTest and MTP mode.
- Structured data that an agent can query, instead of parsing console text.
Open questions
- Format: XML now, through the existing
TestOutputXml/OutputXmlFolderModemechanism, or JSON once the framework has its serializer? A first step could be to print the path line in agent mode whenTestOutputXmlis set. - Default in agent mode, or opt-in? Writing a file on every run costs I/O and leaves files behind. Opt-in costs discoverability.
- Stale files: overwrite on every run and include a run timestamp, so an agent does not read the result of an old run after a build failure.
- Many files: one per test assembly and target framework. Use predictable names in the results directory, or an index file.
- Overlap with existing loggers:
--logger trxalready writes a full result file. Check what the NUnit file adds beyond TRX for an agent.
🤖 Made by @OsirisTerje with Claude
Activity