Skip to content

Commit d322337

Browse files
Copilotkotlarmilos
andcommitted
Fix xunit v3 test project package conflicts by setting PrivateAssets on xunit v3 packages
Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com>
1 parent 187f323 commit d322337

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

src/Microsoft.DotNet.XHarness.TestRunners.Xunit.v3/Microsoft.DotNet.XHarness.TestRunners.Xunit.v3.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="xunit.v3.extensibility.core" />
12-
<PackageReference Include="xunit.v3.runner.common" />
11+
<PackageReference Include="xunit.v3.extensibility.core" PrivateAssets="all" />
12+
<PackageReference Include="xunit.v3.runner.common" PrivateAssets="all" />
1313
</ItemGroup>
1414

1515

tests/Microsoft.DotNet.XHarness.TestRunners.Xunit.v3.Tests/Microsoft.DotNet.XHarness.TestRunners.Xunit.v3.Tests.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
<TargetFramework>$(NetCurrent)</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<Nullable>disable</Nullable>
7-
<!-- Test project disabled due to xunit v2/v3 package conflicts in CI -->
8-
<!-- The v3 implementation is tested through the main build and integration tests -->
9-
<IsTestProject>false</IsTestProject>
107
</PropertyGroup>
118

129
<ItemGroup>
13-
<!-- Minimal reference to avoid package conflicts -->
1410
<ProjectReference Include="..\..\src\Microsoft.DotNet.XHarness.TestRunners.Common\Microsoft.DotNet.XHarness.TestRunners.Common.csproj" />
11+
<ProjectReference Include="..\..\src\Microsoft.DotNet.XHarness.TestRunners.Xunit.v3\Microsoft.DotNet.XHarness.TestRunners.Xunit.v3.csproj" />
1512
</ItemGroup>
1613

1714
</Project>

tests/Microsoft.DotNet.XHarness.TestRunners.Xunit.v3.Tests/XUnitTestRunnerTests.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
// NOTE: This test project is disabled due to xunit v2/v3 package conflicts in CI.
6-
// The CI infrastructure uses xunit v2 test runner which conflicts with xunit v3 packages
7-
// brought in by the v3 project reference. The xunit v3 implementation itself works correctly
8-
// and is validated through the main build process and integration tests.
9-
105
using System.IO;
116
using System.Linq;
127
using System.Threading.Tasks;
138
using Microsoft.DotNet.XHarness.TestRunners.Common;
9+
using Xunit;
1410

1511
namespace Microsoft.DotNet.XHarness.TestRunners.Xunit.v3.Tests;
1612

1713
public class XUnitTestRunnerTests
1814
{
19-
// Tests disabled - see comment at top of file
20-
/*
2115
[Fact]
2216
public void TestRunner_CanBeCreated()
2317
{
@@ -64,5 +58,4 @@ public async Task TestRunner_CanGenerateBasicResults()
6458
Assert.Equal("test.dll", assemblyElement.Attribute("name")?.Value);
6559
Assert.Contains("xUnit.net", assemblyElement.Attribute("test-framework")?.Value);
6660
}
67-
*/
6861
}

0 commit comments

Comments
 (0)