Skip to content

Commit

Permalink
[ci] Avoid duplicating trx file on helix, and copy it for playground …
Browse files Browse the repository at this point in the history
…tests also
  • Loading branch information
radical committed Aug 10, 2024
1 parent 7263e53 commit 44a60c1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
8 changes: 5 additions & 3 deletions tests/helix/send-to-helix-basictests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<NeedsDcpPathOverride>true</NeedsDcpPathOverride>
</PropertyGroup>

<ItemGroup>
<HelixPostCommand Condition="'$(OS)' != 'Windows_NT'" Include="mv $(_HelixLogsPath)/TestResults.trx $(_HelixLogsPath)/$(_TestNameEnvVar).trx" />
<HelixPostCommand Condition="'$(OS)' == 'Windows_NT'" Include="move &quot;$(_HelixLogsPath)\TestResults.trx&quot; &quot;$(_HelixLogsPath)\$(_TestNameEnvVar).trx&quot;" />
</ItemGroup>

<Target Name="BuildHelixWorkItemsForDefaultTests">
<ItemGroup>
<!-- needed for Aspire.Hosting.Container.Tests -->
Expand All @@ -26,9 +31,6 @@
<PayloadArchive>%(Identity)</PayloadArchive>
<PreCommands>$(_EnvVarSetKeyword) &quot;TEST_NAME=%(FileName)&quot;</PreCommands>

<PostCommands Condition="'$(OS)' != 'Windows_NT'">cp $(_HelixLogsPath)/TestResults.trx $(_HelixLogsPath)/$(_TestNameEnvVar).trx</PostCommands>
<PostCommands Condition="'$(OS)' == 'Windows_NT'">copy &quot;$(_HelixLogsPath)\TestResults.trx&quot; &quot;$(_HelixLogsPath)\$(_TestNameEnvVar).trx&quot;</PostCommands>

<Command>$(_TestRunCommand)</Command>
<Timeout>$(_workItemTimeout)</Timeout>

Expand Down
5 changes: 4 additions & 1 deletion tests/helix/send-to-helix-buildonhelixtests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

<HelixPreCommand Condition="'$(OS)' == 'Windows_NT'" Include="set NUGET_PACKAGES=%HELIX_WORKITEM_ROOT%\nuget-cache\" />
<HelixPreCommand Condition="'$(OS)' != 'Windows_NT'" Include="export NUGET_PACKAGES=$HELIX_WORKITEM_ROOT/nuget-cache/" />

<HelixPostCommand Condition="'$(OS)' != 'Windows_NT'" Include="mv $(_HelixLogsPath)/TestResults.trx $(_HelixLogsPath)/$(_TestNameEnvVar).trx" />
<HelixPostCommand Condition="'$(OS)' == 'Windows_NT'" Include="move &quot;$(_HelixLogsPath)\TestResults.trx&quot; &quot;$(_HelixLogsPath)\$(_TestNameEnvVar).trx&quot;" />
</ItemGroup>

<!-- `dotnet build` + `dotnet test` on helix -->
Expand Down Expand Up @@ -51,7 +54,7 @@
<Timeout>00:15:00</Timeout>

<!-- Download results file so coverage files can be extracted -->
<DownloadFilesFromResults>logs/%(FileName).cobertura.xml</DownloadFilesFromResults>
<DownloadFilesFromResults>logs/%(FileName).cobertura.xml;logs/%(FileName).trx</DownloadFilesFromResults>
</HelixWorkItem>
</ItemGroup>
</Target>
Expand Down
8 changes: 5 additions & 3 deletions tests/helix/send-to-helix-endtoendtests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<NeedsWorkload>true</NeedsWorkload>
</PropertyGroup>

<ItemGroup>
<HelixPostCommand Condition="'$(OS)' != 'Windows_NT'" Include="cp $(_HelixLogsPath)/TestResults.trx $(_HelixLogsPath)/Aspire.EndToEnd.Tests-${TEST_SCENARIO}.trx" />
<HelixPostCommand Condition="'$(OS)' == 'Windows_NT'" Include="copy &quot;$(_HelixLogsPath)\TestResults.trx&quot; &quot;$(_HelixLogsPath)\Aspire.EndToEnd.Tests-%TEST_SCENARIO%.trx&quot;" />
</ItemGroup>

<Target Name="BuildHelixWorkItemsForEnd2EndTests">
<PropertyGroup>
<_E2ETestsArchivePath>$(TestArchiveTestsDirForEndToEndTests)Aspire.EndToEnd.Tests.zip</_E2ETestsArchivePath>
Expand Down Expand Up @@ -42,9 +47,6 @@
<PreCommands>%(PreCommands) $(_ShellCommandSeparator) $(_EnvVarSetKeyword) &quot;TEST_SCENARIO=%(Identity)&quot;</PreCommands>
<PreCommands>%(PreCommands) $(_ShellCommandSeparator) $(_EnvVarSetKeyword) &quot;CODE_COV_FILE_SUFFIX=-%(Identity)&quot;</PreCommands>

<PostCommands Condition="'$(OS)' != 'Windows_NT'">cp $(_HelixLogsPath)/TestResults.trx $(_HelixLogsPath)/Aspire.EndToEnd.Tests-%(Identity).trx</PostCommands>
<PostCommands Condition="'$(OS)' == 'Windows_NT'">copy &quot;$(_HelixLogsPath)\TestResults.trx&quot; &quot;$(_HelixLogsPath)\Aspire.EndToEnd.Tests-%(Identity).trx&quot;</PostCommands>

<Command>$(_TestRunCommand)</Command>
<Timeout>$(_workItemTimeout)</Timeout>

Expand Down
7 changes: 4 additions & 3 deletions tests/helix/send-to-helix-workloadtests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<HelixPreCommand Include="$(_EnvVarSetKeyword) TEST_NAME=$(TestProjectName)" />
<!-- xunit diagnostic output doesn't show up on windows, so use SHOW_BUILD_OUTPUT=true -->
<HelixPreCommand Condition="'$(OS)' == 'Windows_NT'" Include="$(_EnvVarSetKeyword) SHOW_BUILD_OUTPUT=true" />

<HelixPostCommand Condition="'$(OS)' != 'Windows_NT'" Include="mv $(_HelixLogsPath)/TestResults.trx $(_HelixLogsPath)/$(TestProjectName)-${TEST_NAME_SUFFIX}.trx" />
<HelixPostCommand Condition="'$(OS)' == 'Windows_NT'" Include="move &quot;$(_HelixLogsPath)\TestResults.trx&quot; &quot;$(_HelixLogsPath)\$(TestProjectName)-%TEST_NAME_SUFFIX%.trx&quot;" />
</ItemGroup>

<Target Name="BuildHelixWorkItemsForWorkloadTests">
Expand Down Expand Up @@ -41,13 +44,11 @@

<PreCommands>$(_EnvVarSetKeyword) &quot;TEST_NAME=%(FileName)&quot;</PreCommands>
<PreCommands>%(PreCommands) $(_ShellCommandSeparator) $(_EnvVarSetKeyword) &quot;CODE_COV_FILE_SUFFIX=-%(TestNameSuffix)&quot;</PreCommands>
<PreCommands>%(PreCommands) $(_ShellCommandSeparator) $(_EnvVarSetKeyword) &quot;TEST_NAME_SUFFIX=%(TestNameSuffix)&quot;</PreCommands>

<PreCommands Condition="'$(OS)' == 'Windows_NT'">%(PreCommands) $(_ShellCommandSeparator) set &quot;TEST_ARGS=--filter category^^!=failing^&amp;FullyQualifiedName~%(Identity)&quot;</PreCommands>
<PreCommands Condition="'$(OS)' != 'Windows_NT'">%(PreCommands) $(_ShellCommandSeparator) export &quot;TEST_ARGS=--filter category!=failing&amp;FullyQualifiedName~%(Identity)&quot;</PreCommands>

<PostCommands Condition="'$(OS)' != 'Windows_NT'">cp $(_HelixLogsPath)/TestResults.trx $(_HelixLogsPath)/$(TestProjectName)-%(TestNameSuffix).trx</PostCommands>
<PostCommands Condition="'$(OS)' == 'Windows_NT'">copy &quot;$(_HelixLogsPath)\TestResults.trx&quot; &quot;$(_HelixLogsPath)\$(TestProjectName)-%(TestNameSuffix).trx&quot;</PostCommands>

<Command>$(_TestRunCommand)</Command>
<Timeout>$(_workItemTimeout)</Timeout>

Expand Down

0 comments on commit 44a60c1

Please sign in to comment.