Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Avoid special casing work items in sendtohelixhelp.proj #46156

Open
radical opened this issue Dec 16, 2020 · 8 comments
Open

Avoid special casing work items in sendtohelixhelp.proj #46156

radical opened this issue Dec 16, 2020 · 8 comments
Assignees
Milestone

Comments

@radical
Copy link
Member

radical commented Dec 16, 2020

    <ItemGroup Condition="'$(TargetOS)' == 'Browser'">
      <!-- Create a work item for run-only WASM apps  -->
      <_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/*.zip" />
      <HelixWorkItem Include="@(_RunOnlyWorkItem -> '%(FileName)')" >
        <PayloadArchive>%(Identity)</PayloadArchive>
        <!-- No RunTests script generated for the sample project so we just use the direct command -->
        <Command>dotnet exec $XHARNESS_CLI_PATH wasm $XHARNESS_COMMAND  --app=. --engine=V8  --engine-arg=--stack-trace-limit=1000 --js-file=runtime.js --output-directory=$XHARNESS_OUT -- --run WasmSample.dll</Command>
      </HelixWorkItem>
    </ItemGroup>

Instead of this, we could try generating RunTests.sh which is done by

<UsingTask TaskName="GenerateRunScript" AssemblyFile="$(InstallerTasksAssemblyPath)"/>
<Target Name="GenerateRunScript">
.

Based on @safern's comment #45768 (comment)

I think I would rather do that and try to be consistent, it seems cumbersome to have that "workaround" in sendhelix to include the sample as part of the payload and hardcode the HelixCommand.

Can we open a follow up issue to clean this up and make it more generic for more samples? I see we also added this for iOS and it is doing somewhat similar instead of use the targets we already have.
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Dec 16, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@radical
Copy link
Member Author

radical commented Dec 16, 2020

/cc @akoeplinger @MaximLipnin

@premun
Copy link
Member

premun commented Dec 16, 2020

@radical please note that RunTest.sh is not used for Helix but only in local development.

For iOS and Android, we use the Helix SDK to take care of running XHarness.

For iOS, we have something like RunTest.sh (but static):
https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/ios-helix-job-payload.sh

For Android, we call XHarness directly in the Helix command:
https://github.com/dotnet/arcade/blob/16b1ec7dc37cd19927eb7a25e76a67236a9c74a0/src/Microsoft.DotNet.Helix/Sdk/CreateXHarnessAndroidWorkItems.cs#L106
but to my best knowledge, @MattGal might be adding a similar script soon to do some emulator restarting.

For WASM, I would suggest to go similar route and add support on Arcade level as well.

@ghost
Copy link

ghost commented Dec 16, 2020

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details
    <ItemGroup Condition="'$(TargetOS)' == 'Browser'">
      <!-- Create a work item for run-only WASM apps  -->
      <_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/*.zip" />
      <HelixWorkItem Include="@(_RunOnlyWorkItem -> '%(FileName)')" >
        <PayloadArchive>%(Identity)</PayloadArchive>
        <!-- No RunTests script generated for the sample project so we just use the direct command -->
        <Command>dotnet exec $XHARNESS_CLI_PATH wasm $XHARNESS_COMMAND  --app=. --engine=V8  --engine-arg=--stack-trace-limit=1000 --js-file=runtime.js --output-directory=$XHARNESS_OUT -- --run WasmSample.dll</Command>
      </HelixWorkItem>
    </ItemGroup>

Instead of this, we could try generating RunTests.sh which is done by

<UsingTask TaskName="GenerateRunScript" AssemblyFile="$(InstallerTasksAssemblyPath)"/>
<Target Name="GenerateRunScript">
.

Based on @safern's comment #45768 (comment)

I think I would rather do that and try to be consistent, it seems cumbersome to have that "workaround" in sendhelix to include the sample as part of the payload and hardcode the HelixCommand.

Can we open a follow up issue to clean this up and make it more generic for more samples? I see we also added this for iOS and it is doing somewhat similar instead of use the targets we already have.
Author: radical
Assignees: -
Labels:

area-Infrastructure-mono, untriaged

Milestone: -

@steveisok steveisok added this to the 6.0.0 milestone Dec 16, 2020
@safern
Copy link
Member

safern commented Dec 16, 2020

@premun yeah that's correct. However for iOS we should try to also binplace the sample app into TestArchiveTestsRoot so that we don't have to duplicate logic in sendtohelixhelp.proj:

<XHarnessAppBundleToTest Include="$([System.IO.Directory]::GetDirectories('$(TestArchiveTestsRoot)', '*.app', System.IO.SearchOption.AllDirectories))">
<Targets Condition="'$(TargetArchitecture)' == 'arm'">ios-device</Targets>
<Targets Condition="'$(TargetArchitecture)' == 'arm64'">ios-device</Targets>
<Targets Condition="'$(TargetArchitecture)' == 'x64'">ios-simulator-64</Targets>
<Targets Condition="'$(TargetArchitecture)' == 'x86'">ios-simulator-32</Targets>
<TestTimeout>$(_workItemTimeout)</TestTimeout>
<LaunchTimeout>$(_workItemTimeout)</LaunchTimeout>
</XHarnessAppBundleToTest>
<!-- Create work items for run-only apps -->
<XHarnessAppBundleToTest Include="$([System.IO.Directory]::GetDirectories('$(TestArchiveRoot)runonly', '*.app', System.IO.SearchOption.AllDirectories))" >
<Targets Condition="'$(TargetArchitecture)' == 'arm'">ios-device</Targets>
<Targets Condition="'$(TargetArchitecture)' == 'arm64'">ios-device</Targets>
<Targets Condition="'$(TargetArchitecture)' == 'x64'">ios-simulator-64</Targets>
<Targets Condition="'$(TargetArchitecture)' == 'x86'">ios-simulator-32</Targets>
<LaunchTimeout>$(_workItemTimeout)</LaunchTimeout>
<!-- The sample app doesn't need test runner -->
<IncludesTestRunner>false</IncludesTestRunner>
<!-- The sample's C# Main method returns 42 so it should be considered by xharness as a success -->
<ExpectedExitCode>42</ExpectedExitCode>
</XHarnessAppBundleToTest>

@MaximLipnin
Copy link
Contributor

@safern As for iOS, could you point me to other way besides putting to separate directories to differentiate the sample from test apps in order to set a couple of specific properties?

@mdh1418
Copy link
Member

mdh1418 commented Jul 20, 2022

@radical I took a look and it seems like there were significant modifications to sendtohelix*(help/mobile/wasm).proj since this issue was first created. I'm not sure if I'm interpreting things correctly. It seems like this issue aims to remove hardcoded/special cased HelixWorkItem by using RunTest.sh generated through GenerateRunScript, but comments suggest this is more of an effort to remove duplicate code?

Is this still relevant, might be worth pushing to 8 if it isn't urgent.

@radical
Copy link
Member Author

radical commented Jul 22, 2022

@mdh1418 I think we have reduced that quite a bit. But @premun's suggestion in #46156 (comment), we should probably still do that. But it's not urgent at all. Moving to Future milestone.

@radical radical modified the milestones: 7.0.0, Future Jul 22, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 22, 2022
@jeffschwMSFT jeffschwMSFT removed the untriaged New issue has not been triaged by the area owner label Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants