spekt / xunit.testlogger

XUnit logger for vstest platform
MIT License
73 stars 15 forks source link

Results file is not created when there are more than one test with the same name in different collections #43

Closed renycorreia closed 9 months ago

renycorreia commented 1 year ago

When, in the same assembly, but in different collections, we have tests with the exact same name, the xml file is not created.

XunitXml.TestLogger version 3.0.78

codito commented 10 months ago

@renycorreia could you please help with a repro project?

I tried with below code in a fresh project created with dotnet new xunit.

namespace trial;

public class TestFixture
{
}

[CollectionDefinition("MyCollection")]
public class CollectionClass : ICollectionFixture<TestFixture>
{
}

[Collection("MyCollection")]
public class UnitTest1
{
    [Fact]
    public void Test1()
    {
    }
}

[Collection("MyCollection2")]
public class UnitTest2
{
    [Fact]
    public void Test1()
    {
    }
}

TestResults.xml is generated with dotnet test --logger:xunit as expected.

codito commented 9 months ago

Closing due to inactivity.