Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use XHarnessApkToTest to create helix work items for runtime tests when running on Android #57292

Merged
merged 28 commits into from
Sep 9, 2021
Merged
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
36d1f1c
Try to use CustomCommand for Android jobs
fanyang-mono Aug 12, 2021
ff29bc4
Moved property group outside of item group.
Aug 17, 2021
a94d8b0
Reverted commenting in runtime.yml
Aug 18, 2021
3f1eaaf
reverted comment change to global-build.yml
Aug 18, 2021
e719166
Target->TestTarget
Aug 17, 2021
0b86790
Fixed item group nesting.
Aug 18, 2021
4b8241b
Added version string.
Aug 24, 2021
1637f73
Define HelixWorkItem and XHarnessApkToTest after defining Payloads
fanyang-mono Aug 25, 2021
5858e9a
Disable more unrelated lanes when experimenting
fanyang-mono Aug 25, 2021
75b4538
Remove the code to only run one test
fanyang-mono Aug 25, 2021
36d6a57
Uncomment global-build
fanyang-mono Aug 26, 2021
c21bbee
Uncomment some jobs
fanyang-mono Aug 26, 2021
fc45a06
Uncomment mono and library build jobs
fanyang-mono Aug 26, 2021
144cf99
Uncomment more mono build jobs
fanyang-mono Aug 26, 2021
21e40bd
Uncomment more mono jobs
fanyang-mono Aug 26, 2021
6f0317b
Fix app path
fanyang-mono Aug 26, 2021
6c16801
Keep full path
fanyang-mono Aug 27, 2021
49a1e63
Use zip files as XHarnessApkToTest inputs
fanyang-mono Sep 2, 2021
5d19f98
Fix attribute error
fanyang-mono Sep 2, 2021
77a4115
Fix syntax
fanyang-mono Sep 3, 2021
696d8b7
Update src/tests/Common/helixpublishwitharcade.proj
fanyang-mono Sep 7, 2021
747eba8
Zip payload folder after target PreparePayloadsDirectories
fanyang-mono Sep 8, 2021
abd070f
Revert the hack
fanyang-mono Sep 8, 2021
0115d42
Revert unwanted changes
fanyang-mono Sep 8, 2021
ad16e11
Remove typo
fanyang-mono Sep 8, 2021
80c2d4c
Address review feedback
fanyang-mono Sep 8, 2021
438d2c9
Add back timeout threshold
fanyang-mono Sep 8, 2021
1472437
Remove redundant var
fanyang-mono Sep 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/tests/Common/helixpublishwitharcade.proj
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,18 @@
<MSBuild Projects="@(_ProjectsToBuild)" Targets="CreateTestEnvFiles" StopOnFirstFailure="true" />
</Target>

<Target Name="ZipPayloadDirectory" AfterTargets="PreparePayloadsDirectories" Condition="'$(TargetOS)' == 'Android'">
<ItemGroup>
<Payloads Include="$([System.IO.Directory]::GetDirectories($(PayloadsRootDirectory)))" Condition="Exists('$(PayloadsRootDirectory)')" />
<Payloads Update="@(Payloads)">
<PayloadGroup>$([MSBuild]::MakeRelative($(PayloadsRootDirectory), %(FullPath)))</PayloadGroup>
<PayloadDirectory>%(FullPath)</PayloadDirectory>
</Payloads>
</ItemGroup>

<ZipDirectory SourceDirectory="@(Payloads->Metadata('PayloadDirectory'))" DestinationFile="$(PayloadsRootDirectory)\%(Payloads.PayloadGroup).zip" />
</Target>

<PropertyGroup>
<EnableAzurePipelinesReporter>$(PublishTestResults)</EnableAzurePipelinesReporter>
<EnableAzurePipelinesReporter Condition=" '$(EnableAzurePipelinesReporter)' == '' ">false</EnableAzurePipelinesReporter>
Expand Down Expand Up @@ -316,6 +328,11 @@
<XUnitRunnerDll>%CORE_ROOT%\xunit\xunit.console.dll</XUnitRunnerDll>
</PropertyGroup>

<PropertyGroup>
<IsRunningOnMobileTargets>false</IsRunningOnMobileTargets>
<IsRunningOnMobileTargets Condition="'$(TargetOS)' == 'Android' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOSSimulator' ">true</IsRunningOnMobileTargets>
</PropertyGroup>

<PropertyGroup Condition=" '$(TestWrapperTargetsWindows)' != 'true' ">
<XUnitRunnerDll>$CORE_ROOT/xunit/xunit.console.dll</XUnitRunnerDll>
</PropertyGroup>
Expand All @@ -328,21 +345,28 @@
<PayloadGroup>$([MSBuild]::MakeRelative($(PayloadsRootDirectory), %(FullPath)))</PayloadGroup>
<PayloadDirectory>%(FullPath)</PayloadDirectory>
<XUnitWrapperDlls>$([System.String]::Join(' ', $([System.IO.Directory]::GetFiles(%(FullPath), '*.XUnitWrapper.dll', SearchOption.AllDirectories))).Replace($([MSBuild]::EnsureTrailingSlash(%(FullPath))),''))</XUnitWrapperDlls>
<RuntimeTestApks>$([System.String]::Join(' ', $([System.IO.Directory]::GetFiles(%(FullPath), '*.apk', SearchOption.AllDirectories))))</RuntimeTestApks>
</Payloads>

<Payloads Update="@(Payloads)">
<TestGroup>%(PayloadGroup)</TestGroup>
<!-- When Payload contains more than one *.XUnitWrapper.dll TestGroup should not be specified. -->
<TestGroup Condition=" $([MSBuild]::ValueOrDefault(%(XUnitWrapperDlls), '').IndexOf('.XUnitWrapper.dll')) != $([MSBuild]::ValueOrDefault(%(XUnitWrapperDlls), '').LastIndexOf('.XUnitWrapper.dll')) "></TestGroup>
<PayloadZipFile>$(PayloadsRootDirectory)\%(PayloadGroup).zip</PayloadZipFile>
</Payloads>

<HelixWorkItem Include="@(Payloads->Metadata('PayloadGroup'))">
<HelixWorkItem Include="@(Payloads->Metadata('PayloadGroup'))" Condition=" '$(IsRunningOnMobileTargets)' == 'false' ">
<PayloadDirectory>%(PayloadDirectory)</PayloadDirectory>
<Command>dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs)</Command>
<Command Condition=" '%(TestGroup)' != '' ">dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs) -trait TestGroup=%(TestGroup)</Command>
<Timeout Condition=" '$(TimeoutPerTestCollectionInMinutes)' != '' ">$([System.TimeSpan]::FromMinutes($(TimeoutPerTestCollectionInMinutes)))</Timeout>
</HelixWorkItem>

<XHarnessApkToTest Include="@(Payloads->Metadata('PayloadZipFile'))" Condition="'$(TargetOS)' == 'Android'">
<CustomCommands>dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs)</CustomCommands>
<CustomCommands Condition=" '%(TestGroup)' != '' ">dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs) -trait TestGroup=%(TestGroup)</CustomCommands>
</XHarnessApkToTest>

<HelixWorkItem Condition="'$(PALTestsDir)' != '' and '$(TestWrapperTargetsWindows)' != 'true'" Include="PALTests">
<PayloadArchive>$(PayloadsRootDirectory)paltests.tar.gz</PayloadArchive>
<Command>./runpaltestshelix.sh</Command>
Expand Down