Skip to content

Commit 869ae1a

Browse files
authored
Ignore exit code returned from the merged wrappers (#64651)
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
1 parent 6527b7f commit 869ae1a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/tests/Common/tests.targets

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,12 @@
7979
</Target>
8080

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

8790
<Target Name="RunMergedTests" DependsOnTargets="PrepareTestsToRun">

0 commit comments

Comments
 (0)