Skip to content

Commit

Permalink
[wasm] Add support for installing latest sdk for workload testing
Browse files Browse the repository at this point in the history
`$(SdkVersionForWorkloadTesting)` can be set to use a specific version.

This is used with workload testing for Wasm.Build.Tests, and with perf
pipeline.
  • Loading branch information
radical authored Apr 5, 2022
1 parent 07d8b82 commit b89638c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
3 changes: 2 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@
<SQLitePCLRawbundle_greenVersion>2.0.4</SQLitePCLRawbundle_greenVersion>
<MoqVersion>4.12.0</MoqVersion>
<FsCheckVersion>2.14.3</FsCheckVersion>
<SdkVersionForWorkloadTesting>7.0.100-preview.3.22151.18</SdkVersionForWorkloadTesting>
<!-- Uncomment to set a fixed version, else the latest is used -->
<!--<SdkVersionForWorkloadTesting>7.0.100-preview.3.22151.18</SdkVersionForWorkloadTesting>-->
<CompilerPlatformTestingVersion>1.1.2-beta1.22122.4</CompilerPlatformTestingVersion>
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>7.0.0-preview-20220331.1</MicrosoftPrivateIntellisenseVersion>
Expand Down
34 changes: 28 additions & 6 deletions eng/testing/workloads-testing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
Condition="!Exists($(SdkWithNoWorkloadStampPath)) or !Exists($(SdkWithWorkloadStampPath))">

<Error Text="%24(SdkWithWorkloadForTestingPath) is not set" Condition="'$(SdkWithWorkloadForTestingPath)' == ''" />
<Error Text="%24(SdkVersionForWorkloadTesting) is not set" Condition="'$(SdkVersionForWorkloadTesting)' == ''" />

<Message Text="** Installing sdk $(SdkVersionForWorkloadTesting) for workload based tests into $(SdkWithWorkloadForTestingPath)" Importance="High" />
<Message Text="** Installing sdk $(SdkVersionForWorkloadTesting) for workload based tests into $(SdkWithWorkloadForTestingPath)"
Condition="'$(SdkVersionForWorkloadTesting)' != ''"
Importance="High" />
<Message Text="** Installing latest sdk for workload based tests into $(SdkWithWorkloadForTestingPath)"
Condition="'$(SdkVersionForWorkloadTesting)' == ''"
Importance="High" />

<RemoveDir Directories="$(SdkWithWorkloadForTestingPath)" />
<MakeDir Directories="$(SdkWithWorkloadForTestingPath)" />
Expand All @@ -28,9 +32,13 @@

<Target Name="_ProvisionSdkWithNoWorkload" Condition="!Exists($(SdkWithNoWorkloadStampPath))">
<Error Text="%24(SdkWithNoWorkloadForTestingPath) is not set" Condition="'$(SdkWithNoWorkloadForTestingPath)' == ''" />
<Error Text="%24(SdkVersionForWorkloadTesting) is not set" Condition="'$(SdkVersionForWorkloadTesting)' == ''" />

<Message Text="** Installing sdk $(SdkVersionForWorkloadTesting) for workload based tests into $(SdkWithNoWorkloadForTestingPath)" Importance="High" />
<Message Text="** Installing sdk $(SdkVersionForWorkloadTesting) for workload based tests into $(SdkWithNoWorkloadForTestingPath)"
Condition="'$(SdkVersionForWorkloadTesting)' != ''"
Importance="High" />
<Message Text="** Installing latest sdk for workload based tests into $(SdkWithNoWorkloadForTestingPath)"
Condition="'$(SdkVersionForWorkloadTesting)' == ''"
Importance="High" />

<RemoveDir Directories="$(SdkWithNoWorkloadForTestingPath)" />
<MakeDir Directories="$(SdkWithNoWorkloadForTestingPath)" />
Expand All @@ -42,17 +50,31 @@
<_DotNetInstallScriptPath>$(ArtifactsObjDir)$(_DotNetInstallScriptName)</_DotNetInstallScriptPath>
</PropertyGroup>

<PropertyGroup Condition="'$(SdkVersionForWorkloadTesting)' != ''">
<_DotNetInstallCommand Condition="!$([MSBuild]::IsOSPlatform('windows'))"
>$(_DotNetInstallScriptPath) -i $(SdkWithNoWorkloadForTestingPath) -v $(SdkVersionForWorkloadTesting)</_DotNetInstallCommand>
<_DotNetInstallCommand Condition="$([MSBuild]::IsOSPlatform('windows'))"
>$(_DotNetInstallScriptPath) -InstallDir $(SdkWithNoWorkloadForTestingPath) -Version $(SdkVersionForWorkloadTesting)</_DotNetInstallCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(SdkVersionForWorkloadTesting)' == ''">
<_DotNetInstallCommand Condition="!$([MSBuild]::IsOSPlatform('windows'))"
>$(_DotNetInstallScriptPath) -i $(SdkWithNoWorkloadForTestingPath) -v latest -q daily --channel 7.0</_DotNetInstallCommand>
<_DotNetInstallCommand Condition="$([MSBuild]::IsOSPlatform('windows'))"
>$(_DotNetInstallScriptPath) -InstallDir $(SdkWithNoWorkloadForTestingPath) -Quality daily -Channel 7.0</_DotNetInstallCommand>
</PropertyGroup>

<DownloadFile SourceUrl="https://dot.net/v1/$(_DotNetInstallScriptName)"
DestinationFolder="$(ArtifactsObjDir)"
Retries="3"
Condition="!Exists($(_DotNetInstallScriptPath))"/>

<Exec Condition="!$([MSBuild]::IsOSPlatform('windows'))"
IgnoreStandardErrorWarningFormat="true"
Command="chmod +x $(_DotNetInstallScriptPath); $(_DotNetInstallScriptPath) -i $(SdkWithNoWorkloadForTestingPath) -v $(SdkVersionForWorkloadTesting)" />
Command="chmod +x $(_DotNetInstallScriptPath); $(_DotNetInstallCommand)" />

<Exec Condition="$([MSBuild]::IsOSPlatform('windows'))"
Command='powershell -ExecutionPolicy ByPass -NoProfile -command "&amp; $(_DotNetInstallScriptPath) -InstallDir $(SdkWithNoWorkloadForTestingPath) -Version $(SdkVersionForWorkloadTesting)"' />
Command='powershell -ExecutionPolicy ByPass -NoProfile -command "&amp; $(_DotNetInstallCommand)"' />

<WriteLinesToFile File="$(SdkWithNoWorkloadStampPath)" Lines="" Overwrite="true" />
</Target>
Expand Down

0 comments on commit b89638c

Please sign in to comment.