Skip to content

If a TRX file contains no tests, the plugin crashes #64

@CAP-3Shape

Description

@CAP-3Shape

Microsoft.Testing.Platform for .NET will sometimes generate an "empty" TRX file containing no tests. The TRX file is valid according to the TRX specification, I believe, but contains no tests.

This happens if I set a filter on my test execution (dotnet-test) and this filter happens to exclude all tests in one of the assemblies (DLLs). Microsoft.Testing.Platform will generate one TRX file per assembly. If one assembly has no tests (i.e., all tests in the assembly are skipped), the platform will still generate a TRX file, but it will contain no tests.

The test-reporting plugin cannot handle this. It will crash with the error message:

Error: td.UnitTest is not iterable

Here is a minimal working example that reproduces the problem: https://github.com/CAP-3Shape/MstTrx/actions/runs/14441752164/job/40493252607

I believe this is a bug in the test-reporting plugin. Do you agree?

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions