Invoke dotnet vstest directly instead of using the VSTest target

Attempt to workaround Microsoft/vstest#1503 which causes test failure output to be swallowed
This commit is contained in:
Nate McMaster 2018-07-03 10:08:25 -07:00
parent 55e0fd5677
commit d2d9a47686
No known key found for this signature in database
GPG Key ID: A778D9601BD78810
1 changed files with 16 additions and 1 deletions

View File

@ -540,9 +540,24 @@
RepositoryCommit=$(RepositoryCommit);
SharedFxRuntimeIdentifier=$(SharedFXRid)
</UnitTestFxTestProps>
<TrxFile>$(LogOutputDir)SharedFx.UnitTests-$(BuildNumber).trx</TrxFile>
</PropertyGroup>
<MSBuild Projects="$(UnitTestFxProject)" Targets="Restore" Properties="_Dummy=restore;$(UnitTestFxTestProps)" />
<MSBuild Projects="$(UnitTestFxProject)" Targets="VSTest" Properties="$(UnitTestFxTestProps)" />
<MSBuild Projects="$(UnitTestFxProject)" Targets="Build" Properties="$(UnitTestFxTestProps)">
<Output TaskParameter="TargetOutputs" ItemName="SharedFxTestAssembly" />
</MSBuild>
<RunDotNet Arguments="vstest;
--Framework:%(TargetFrameworkIdentifier),Version=v%(TargetFrameworkVersion);
--Logger:$([MSBuild]::Escape('trx;LogFileName=$(TrxFile)'));
%(SharedFxTestAssembly.Identity);
--;RunConfiguration.NoAutoReporters=true" IgnoreExitCode="true">
<Output TaskParameter="ExitCode" PropertyName="VsTestExitCode" />
</RunDotNet>
<Message Text="##teamcity[importData type='vstest' path='$(TrxFile)']"
Importance="High"
Condition="'$(TEAMCITY_VERSION)' != '' AND Exists($(TrxFile))" />
<Error Text="SharedFx.UnitTests failed with exit code '$(VsTestExitCode)'." Condition=" $(VsTestExitCode) != 0 " />
</Target>
</Project>