Skip to content

Commit

Permalink
Ignore exit code returned from the merged wrappers (#64651)
Browse files Browse the repository at this point in the history
JanV noticed that crash in one of the merged wrappers automatically
fails the test execution script so that subsequent wrappers and
the legacy xUnit wrappers don't get run. This simple change fixes
the issue by ignoring the wrapper exit code.

Thanks

Tomas
  • Loading branch information
trylek committed Feb 2, 2022
1 parent 6527b7f commit 869ae1a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/tests/Common/tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@
</Target>

<Target Name="RunSingleMergedTest">
<Exec Command="chmod +x $(TestWrapperScript)" WorkingDirectory="$(BaseOutputPathWithConfig)" Condition="'$(TargetOS)' != 'windows'" />
<Exec Command="$(TestWrapperScript) &gt;$(RedirectOutputToFile)" WorkingDirectory="$(BaseOutputPathWithConfig)" Timeout="$(__TestTimeout)" />
<Copy SourceFiles="$(TestResultsXmlFile)" DestinationFiles="$(TestResultsCopyTo)" />
<Exec Command="chmod +x $(TestWrapperScript)" WorkingDirectory="$(BaseOutputPathWithConfig)" EchoOff="true" Condition="'$(TargetOS)' != 'windows'" />
<Exec Command="$(TestWrapperScript) &gt;$(RedirectOutputToFile)" WorkingDirectory="$(BaseOutputPathWithConfig)" Timeout="$(__TestTimeout)" IgnoreExitCode="true">
<Output TaskParameter="ExitCode" PropertyName="MergedTestExitCode" />
</Exec>
<Copy SourceFiles="$(TestResultsXmlFile)" DestinationFiles="$(TestResultsCopyTo)" Condition="'$(MergedTestExitCode)' == '0'" />
<Message Importance="High" Text="Error running test group '$(TestWrapperScript)' - exit code $(MergedTestExitCode)" Condition="'$(MergedTestExitCode)' != '0'" />
</Target>

<Target Name="RunMergedTests" DependsOnTargets="PrepareTestsToRun">
Expand Down

0 comments on commit 869ae1a

Please sign in to comment.