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

Add Runtime portion of android startup scenario #61861

Merged
merged 66 commits into from
Dec 8, 2021

Conversation

LoopedBard3
Copy link
Member

Add runtime portion of android startup scenario. This included adding a diagnostic version of the android file, passing it through the pipeline, and making sure xharness was installed for use.

LoopedBard3 and others added 30 commits November 9, 2021 11:38
Stop codespaces workflow
…print out stuff so run commands are printed. This is for testing to understand how this works in the pipeline.
…t timing out and thus not getting the stout of xharness.
Stop codespaces workflow
@dotnet-issue-labeler
Copy link

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

@LoopedBard3 LoopedBard3 changed the title Add performance portion of android startup scenario Add Runtime portion of android startup scenario Nov 30, 2021
@LoopedBard3 LoopedBard3 marked this pull request as ready for review November 30, 2021 22:47
<PropertyGroup>
<IncludeXHarnessCli>true</IncludeXHarnessCli>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.21566.2</MicrosoftDotNetXHarnessCLIVersion>
<XharnessPath>%HELIX_CORRELATION_PAYLOAD%\microsoft.dotnet.xharness.cli\$(MicrosoftDotNetXHarnessCLIVersion)\tools\net6.0\any\Microsoft.DotNet.XHarness.CLI.dll</XharnessPath>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path has the TFM net6.0 in it. Do we know where that information comes from, and when we will need to update it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to set this. There will be a variable %XHARNESS_CLI_PATH% set for you with this path if you need it on the Helix machine so you can just use that one.

Once you start calling XHarness the right way (we agreed with Parker that this solution is temporary) via the XHarness Helix SDK, you can just call xharness via xharness android ... and won't need this path in your scripts at all.

@@ -124,7 +124,7 @@ if ($RunFromPerformanceRepo) {
robocopy $SourceDirectory $PerformanceDirectory /E /XD $PayloadDirectory $SourceDirectory\artifacts $SourceDirectory\.git
}
else {
git clone --branch main --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory
git clone --branch add-android-startup --depth 1 --quiet https://github.com/loopedbard3/performance $PerformanceDirectory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove before final check-in

Copy link
Member

@DrewScoggins DrewScoggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of small changes, but overall LGTM.

Copy link
Member

@premun premun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, this will probably work but won't be sufficient later on so I left a manual how to onboard the XHarness SDK later.

<PropertyGroup>
<IncludeXHarnessCli>true</IncludeXHarnessCli>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.21566.2</MicrosoftDotNetXHarnessCLIVersion>
<XharnessPath>%HELIX_CORRELATION_PAYLOAD%\microsoft.dotnet.xharness.cli\$(MicrosoftDotNetXHarnessCLIVersion)\tools\net6.0\any\Microsoft.DotNet.XHarness.CLI.dll</XharnessPath>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to set this. There will be a variable %XHARNESS_CLI_PATH% set for you with this path if you need it on the Helix machine so you can just use that one.

Once you start calling XHarness the right way (we agreed with Parker that this solution is temporary) via the XHarness Helix SDK, you can just call xharness via xharness android ... and won't need this path in your scripts at all.

@@ -1,4 +1,9 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">
<PropertyGroup>
<IncludeXHarnessCli>true</IncludeXHarnessCli>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.21566.2</MicrosoftDotNetXHarnessCLIVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to set MicrosoftDotNetXHarnessCLIVersion as it should come from https://github.com/dotnet/runtime/blob/main/eng/Versions.props

@@ -42,5 +47,11 @@
<Command>$(Python) test.py sod --scenario-name &quot;%(Identity)&quot;</Command>
<PostCommands>$(Python) post.py</PostCommands>
</HelixWorkItem>
<HelixWorkItem Include="Startup - Android HelloWorld">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are nearly there with the proper way how to use the XHarness SDK.
You can go with what you have for now as we agreed but a gentle reminder that we will require you to switch later.

We can also do it inside of this PR if you want, it should be fairly straightforward:

  1. You need to zip the $(WorkItemDirectory) first
  2. Instead of HelixWorkItem, you define a <XHarnessApkToTest Include="Startup - Android HelloWorld">
  3. Instead of PayloadDirectory you set ApkPath and point it to the zipped file from 1.
  4. Instead of PreCommands, Command and PostCommands, you will specify just one CustomCommands with the commands inside

Altogether, something like this:

<XHarnessApkToTest Include="Startup - Android HelloWorld">
  <ApkPath>$(PathToTheZippedWorkItemDirectory)</ApkPath>
  <CustomCommands>
    <![CDATA[
      echo on
      set XHARNESSPATH=$(XharnessPath)            <---- this is not needed as noted above
      cd $(ScenarioDirectory)helloandroid
      copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroidWithDiag.apk .
      $(Python) pre.py
      $(Python) test.py devicestartup --device-type android --package-path pub\HelloAndroidWithDiag.apk --package-name net.dot.HelloAndroid --exit-code 42 --scenario-name &quot;%(Identity)&quot;
      $(Python) post.py
    ]]>
  </CustomCommands>
</XHarnessApkToTest>

(you don't even have to probably use things like &quot; inside CDATA)

@LoopedBard3 LoopedBard3 merged commit c8ede5c into dotnet:main Dec 8, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jan 7, 2022
@LoopedBard3 LoopedBard3 deleted the add-android-startup branch March 1, 2022 00:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants