Skip to content

Distinguish parameterized test arguments as distinct tests in xunit-output #8299

Open
@shomron

Description

@shomron

Motivation

Parameterized tests are currently represented as a single <testcase> in xUnit output. This makes it difficult to distinguish how many individual runs of the test with distinct parameters passed or failed, and to correlate them back to which input they passed/failed on.

We use parameterized tests extensively as "table driven tests", where common logic is exercised against various input/output expectations represented as an array of test cases.

The current xunit output is not well adapted to this pattern, and we'd love to look for ways of representing the individual [test, arguments] tuples as distinct <testcase> elements in the report.

Proposed solution

It might make senes to model parameterized tests as their own nested test suites, with their arguments as individual cases. The test cases could be named after the testDescription, assuming that argument adopts CustomTestStringConvertible.

Alternatives considered

No response

Additional information

No response

Metadata

Metadata

Labels

enhancementpublic APIChanges to the public API of SwiftPMswift testChanges impacting `swift test` tool

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions