You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Discussion] Should Microsoft.Testing.Platform support CTRF (Common Test Report Format)? #8858
CTRF (Common Test Report Format) is an emerging open standard that defines a unified JSON format for test outcomes across languages and frameworks. The goal is to make test results portable across tools and platforms (reporters, dashboards, CI integrations, AI agents, etc.) without each consumer having to learn TRX, JUnit XML, xUnit XML, NUnit XML, and the various bespoke formats.
The CTRF maintainers explicitly call out C#/.NET as a language where they'd welcome a native implementation, and Microsoft.Testing.Platform (MTP) already has a pluggable report-extension model (TrxReport, HtmlReport, AzureDevOpsReport, …) which makes it a natural home for a first-party reporter.
This issue is to gather opinions on whether MTP should ship native support for CTRF — either as a built-in extension (Microsoft.Testing.Extensions.CtrfReport) following the same pattern as the existing report extensions, or as a documented community extension point.
Questions for the discussion
Is there enough adoption / momentum behind CTRF to warrant first-party support in MTP, or should we wait until the spec hits v1.0.0?
If we do support it, should it be a built-in extension (like TRX/HTML) or live out-of-tree?
Are there gaps in the CTRF schema (e.g., around .NET-specific concepts like data-driven tests, dynamic data, test contexts, retries, hangdumps, in-process logs) that would prevent it from carrying everything we currently expose via TRX?
How does this interact with the existing TRX report extension — do we want feature parity, or is CTRF intended to be a simpler complement?
/cc Brad Wilson (@bradwilson) — you appear in the CTRF contributors list and obviously have a unique perspective from the xUnit side; would love your take on whether MTP supporting CTRF natively would be valuable, and on any pitfalls you've already hit on the xUnit end.
I like the CTRF format because it's extensible, so we can support all the standard values and then add our own extensions. Over time, if they codify some of the things we do as extensions, we can move those values over into the standards. I would go so far as to say if xUnit.net were being invented today, we would just choose CTRF and not invent our own format. We are currently using the standard CTRF test result reporter in GitHub actions.
Success example:
Failure example:
There are definitely improvements I'd make here (in particular, I'd like to see the formatted stack trace and message for failures, which are standard parts of CTRF), but on the whole it serves the main purpose of the report. The suite ID isn't particularly useful here, but I haven't come up with an alternative I like better than using our computed ID (could use assembly path + config file path, I suppose, since 99% of users never pass custom config files).
If you look at our result writer (starting at ResultWriterMessageHandler.cs#L85), you can see what we put into standard values vs. extensions (anything sitting in an object named extra is outside the spec). The things that are extensions today include:
Inside the top level /results element:
Non-standard environment information (computer name, user name)
The metadata about "test suites" (for us, one per test assembly), including:
Environment and timing information
A list of test collections
A list of errors (non-test failures)
Inside of /results/summary/tests, per test:
We separate traits named Category as CTRF standard tags
As extras, we add CLR type and method names, output, warnings, traits, and CLR exception type for failures
Activity
bradwilson commentedon Jun 5, 2026
My appearance in the contributors list is the equivalent of me finding a typo, so not substantive. 😂
xUnit.net's CTRF support was added at the due to a user request: xunit/xunit#1052 (comment) (which turned into xunit/xunit#2942).
CTRF from us is about equal in size to our XML, and less than half the size of TRX. (HTML is much smaller, but contains a LOT less information.)
I like the CTRF format because it's extensible, so we can support all the standard values and then add our own extensions. Over time, if they codify some of the things we do as extensions, we can move those values over into the standards. I would go so far as to say if xUnit.net were being invented today, we would just choose CTRF and not invent our own format. We are currently using the standard CTRF test result reporter in GitHub actions.
Success example:
Failure example:
There are definitely improvements I'd make here (in particular, I'd like to see the formatted stack trace and message for failures, which are standard parts of CTRF), but on the whole it serves the main purpose of the report. The suite ID isn't particularly useful here, but I haven't come up with an alternative I like better than using our computed ID (could use assembly path + config file path, I suppose, since 99% of users never pass custom config files).
If you look at our result writer (starting at
ResultWriterMessageHandler.cs#L85), you can see what we put into standard values vs. extensions (anything sitting in an object namedextrais outside the spec). The things that are extensions today include:/resultselement:/results/summary/tests, per test:Categoryas CTRF standardtagsAdd Microsoft.Testing.Extensions.CtrfReport extension
Evangelink commentedon Jun 7, 2026
I saw your name but haven't checked the content of your contributions, sorry 😞
Thanks for the detailed output, it seems pretty cheap to support.