meziantou / Meziantou.Xunit.ParallelTestFramework

Run xUnit test cases in parallel
MIT License
156 stars 6 forks source link

Incompatible with xunit.assemblyfixture #7

Open tg2k opened 1 year ago

tg2k commented 1 year ago

If I add this to a project already using xunit.assemblyfixture, there's a conflict due to duplicate Xunit.TestFramework attributes generated. Is there any way to get the benefits of both packages?

meziantou commented 1 year ago

You need to create your own XunitTestFrameworkExecutor that composes both solutions. Note that if only need to run some initialization code (no Dispose), you can use a Module initializer instead of AssemblyFixture.

Also, you can disable the generation of the Xunit.TestFramework attribute by adding the following property to the csproj:

<PropertyGroup>
  <IncludeMeziantouXunitParallelTestFramework>false</IncludeMeziantouXunitParallelTestFramework>
</PropertyGroup>
blrvw commented 1 year ago

I am seeing the same issue as tg2k.
Error CS0579 Duplicate 'Xunit.TestFramework' attribute Do you have any documentation on how to integrate this into an existing XUnitTestFrameworkExecutor so that both can be used?

jusefb commented 1 year ago

I am getting the same issue. Could you please explain how to do this "You need to create your own XunitTestFrameworkExecutor that composes both solutions."

svartis commented 9 months ago

I am also having this issue, so I would also like some more example on how to this.