Skip to content

Commit

Permalink
Don't copy runner to test output during regular builds (dotnet#96826)
Browse files Browse the repository at this point in the history
* Don't copy runner to test output during regular builds

The test runner is not required for local test execution, but is needed
for helix (today).  In the future we should try to change helix to not
expect the runner in the output directory, but instead as a correlation
payload.

* Refine xunit 1651 workaround until we can pick up the fix

* Update eng/testing/xunit/xunit.console.targets

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>

* Update xunit.console.targets

---------

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
  • Loading branch information
3 people authored and tmds committed Jan 23, 2024
1 parent 5d49e3f commit d7f1253
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions eng/testing/xunit/xunit.console.targets
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@

<!-- ResolveAssemblyReferences is the target that populates ReferenceCopyLocalPaths which is what is copied to output directory. -->
<Target Name="CopyRunnerToOutputDirectory" BeforeTargets="ResolveAssemblyReferences" Condition="'$(TargetsMobile)' != 'true' or '$(BundleXunitRunner)' == 'true'">
<ItemGroup>
<!-- Copy test runner to output directory -->
<ItemGroup Condition="'$(ArchiveTests)' == 'true'">
<!-- When ArchiveTests is set, copy xunit.runner.console to output directory -->
<None Include="$([System.IO.Path]::GetDirectoryName('$(XunitConsole472Path)'))\*"
Exclude="$([System.IO.Path]::GetDirectoryName('$(XunitConsole472Path)'))\xunit.console.*exe.config;
$([System.IO.Path]::GetDirectoryName('$(XunitConsole472Path)'))\xunit.console.x86.exe;
Expand All @@ -85,13 +85,5 @@
CopyToOutputDirectory="PreserveNewest"
Visible="false" />
</ItemGroup>

<!-- Workaround for https://github.com/xunit/xunit/issues/1651 -->
<ItemGroup Condition="'$(ArchiveTests)' != 'true'">
<None Remove="$(Pkgxunit_runner_visualstudio)\build\net452\xunit.runner.utility.net452.dll" />
<None Remove="$(Pkgxunit_runner_visualstudio)\build\net452\xunit.runner.reporters.net452.dll" />
<None Remove="$(Pkgxunit_runner_visualstudio)\build\netcoreapp2.1\xunit.runner.utility.netcoreapp10.dll" />
<None Remove="$(Pkgxunit_runner_visualstudio)\build\netcoreapp2.1\xunit.runner.reporters.netcoreapp10.dll" />
</ItemGroup>
</Target>
</Project>

0 comments on commit d7f1253

Please # to comment.