diff --git a/azure-pipelines.yml b/azure-pipelines.yml index be4aeeb3b0f..8f649aa6c82 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -157,7 +157,6 @@ stages: -projects $(Build.SourcesDirectory)\tests\UnitTests.XHarness.Android.Device.proj /bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\Helix.XHarness.Android.Device.binlog /p:RestoreUsingNuGetTargets=false - /p:XHarnessTestARM64_V8A=true displayName: XHarness Android Helix Testing (Windows) env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) @@ -225,8 +224,6 @@ stages: -projects $(Build.SourcesDirectory)/tests/UnitTests.XHarness.Android.Simulator.proj /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/Helix.XHarness.Android.Simulator.binlog /p:RestoreUsingNuGetTargets=false - /p:XHarnessTestX86=true - /p:XHarnessTestX86_64=true displayName: XHarness Android Helix Testing (Linux) env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) diff --git a/src/Microsoft.DotNet.Helix/Sdk/Readme.md b/src/Microsoft.DotNet.Helix/Sdk/Readme.md index 5b8774440e4..dcc734ceb9c 100644 --- a/src/Microsoft.DotNet.Helix/Sdk/Readme.md +++ b/src/Microsoft.DotNet.Helix/Sdk/Readme.md @@ -25,6 +25,8 @@ Each of the following examples require dotnet-cli >= 2.1.300 and need the follow Versions of the package can be found by browsing the feed at https://dev.azure.com/dnceng/public/_packaging?_a=feed&feed=dotnet-eng +### Developing Helix SDK + The examples can all be run with `dotnet msbuild` and will require an environment variable or MSBuildProperty `HelixAccessToken` set if a queue with a value of IsInternalOnly=true (usually any not ending in '.Open') is selected for `HelixTargetQueues`. You will also need to set the following environment variables before building: ``` @@ -36,6 +38,49 @@ BUILD_REASON Also, make sure your helix project doesn't have `EnableAzurePipelinesReporter` set, or sets it to false, or building locally will fail with an error that looks like `SYSTEM_ACCESSTOKEN is not set`. +Furthermore, when you need to make changes to Helix SDK, there's a way to run it locally with ease to test your changes in a tighter dev loop than having to have to wait for the full PR build. + +The repository contains E2E tests that utilize the Helix SDK to send test Helix jobs. +In order to run them, one has to publish the SDK locally so that the unit tests can grab the re-built DLLs. + +#### Detailed steps: +1. Make your changes +2. Build the product + ```sh + # Linux/MacOS + ./build.sh + # Windows + .\Build.cmd + ``` +3. Publish Arcade SDK and Helix SDK + ```sh + dotnet publish -f netcoreapp3.1 src/Microsoft.DotNet.Arcade.Sdk/Microsoft.DotNet.Arcade.Sdk.csproj + dotnet publish -f netcoreapp3.1 src/Microsoft.DotNet.Helix/Sdk/Microsoft.DotNet.Helix.Sdk.csproj + ``` +4. Pick one of the test `.proj` files, set some env variables and build it + Bash + ```sh + export BUILD_REASON=pr + export BUILD_REPOSITORY_NAME=arcade + export BUILD_SOURCEBRANCH=master + export SYSTEM_TEAMPROJECT=dnceng + export SYSTEM_ACCESSTOKEN='' + + eng/common/build.sh -test -projects tests/XHarness.Apple.Device.Tests /v:n /bl:Arcade.binlog + ``` + + PowerShell + ```ps1 + $Env:BUILD_REASON = "pr" + $Env:BUILD_REPOSITORY_NAME = "arcade" + $Env:BUILD_SOURCEBRANCH = "master" + $Env:SYSTEM_TEAMPROJECT = "dnceng" + $Env:SYSTEM_ACCESSTOKEN = "" + + .\eng\common\build.ps1 -configuration Debug -restore -test -projects tests\XHarness.Apple.Device.Tests /p:RestoreUsingNugetTargets=false /bl:Arcade.binlog + ``` +5. An MSBuild log file called `Arcade.binlog` will be produced which you can inspect using the [MSBuild Structured Log Viewer](https://msbuildlog.com/). There you can see which props were set with which values, in what order the targets were executed under which conditions and so on. + ### Docker Support Helix machines now have (where available on the machine) the ability to run work items directly inside Docker containers. This allows work items to use operating systems that only work for Docker scenarios, as well as custom configurations of already-supported operating systems. #### Specifying a docker tag: diff --git a/tests/UnitTests.XHarness.Android.Device.proj b/tests/UnitTests.XHarness.Android.Device.proj index c3aeeb59dff..d0e6020a18b 100644 --- a/tests/UnitTests.XHarness.Android.Device.proj +++ b/tests/UnitTests.XHarness.Android.Device.proj @@ -1,9 +1,10 @@ - - + + XHarnessTestARM64_V8A=true + diff --git a/tests/UnitTests.XHarness.Android.Simulator.proj b/tests/UnitTests.XHarness.Android.Simulator.proj index 11dfbaba887..71451da61c9 100644 --- a/tests/UnitTests.XHarness.Android.Simulator.proj +++ b/tests/UnitTests.XHarness.Android.Simulator.proj @@ -7,9 +7,10 @@ It builds a mock project that does not build an APK directly but only downloads it from a storage account. --> - - + + XHarnessTestX86=true;XHarnessTestX86_64=true + diff --git a/tests/XHarness/XHarness.TestApks.proj b/tests/XHarness/XHarness.TestApks.proj index f44c1c26b3b..a9286f96f45 100644 --- a/tests/XHarness/XHarness.TestApks.proj +++ b/tests/XHarness/XHarness.TestApks.proj @@ -23,6 +23,8 @@ + +