Skip to content

Commit

Permalink
Add support for skipping workloads testing for previous versions (#82742
Browse files Browse the repository at this point in the history
)

* Add support for skipping workloads testing for previous versions

This will skip installing manifests for 6, and 7, for example, and
install only install the latest ones. This is because on release
branches the newest versions might not have public packages available
yet.

* Set $(WorkloadsTestPreviousVersions) in the yml

.. based on the branch. Set it to `true` only for `main`.
  • Loading branch information
radical authored Feb 28, 2023
1 parent ccbcb7f commit 967250c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
8 changes: 7 additions & 1 deletion eng/pipelines/common/templates/wasm-build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jobs:
# map dependencies variables to local variables
- name: alwaysRunVar
value: ${{ parameters.alwaysRun }}
- name: workloadsTestPreviousVersionsVar
value: $[
or(
eq(variables['Build.SourceBranchName'], 'main'),
eq(variables['System.PullRequest.TargetBranch'], 'main'))
]
- name: shouldRunOnDefaultPipelines
value: $[
or(
Expand All @@ -33,7 +39,7 @@ jobs:
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
testGroup: innerloop
nameSuffix: WasmBuildTests
buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmBuildTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs)
buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmBuildTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs) /p:WorkloadsTestPreviousVersions=$(workloadsTestPreviousVersionsVar)
timeoutInMinutes: 180
condition: >-
or(
Expand Down
12 changes: 7 additions & 5 deletions eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,19 @@
<WorkloadIdForTesting Include="wasm-tools-net7;wasm-experimental-net7"
ManifestName="Microsoft.NET.Workload.Mono.ToolChain.net7"
Variant="net7"
Version="$(PackageVersionForWorkloadManifests)" />
Version="$(PackageVersionForWorkloadManifests)"
Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" />

<WorkloadIdForTesting Include="wasm-tools-net6"
ManifestName="Microsoft.NET.Workload.Mono.ToolChain.net6"
Variant="net6"
Version="$(PackageVersionForWorkloadManifests)"
IgnoreErrors="$(WasmIgnoreNet6WorkloadInstallErrors)" />
IgnoreErrors="$(WasmIgnoreNet6WorkloadInstallErrors)"
Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" />

<WorkloadCombinationsToInstall Include="latest" Variants="latest" />
<WorkloadCombinationsToInstall Include="net7" Variants="net7" />
<WorkloadCombinationsToInstall Include="net7+latest" Variants="net7;latest" />
<WorkloadCombinationsToInstall Include="latest" Variants="latest" />
<WorkloadCombinationsToInstall Include="net7" Variants="net7" Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" />
<WorkloadCombinationsToInstall Include="net7+latest" Variants="net7;latest" Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" />
<!--<WorkloadCombinationsToInstall Include="net6" Variants="net6" />-->
<!--<WorkloadCombinationsToInstall Include="net6+7" Variants="net6;net7" />-->
<!--<WorkloadCombinationsToInstall Include="none" />-->
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<SdkWithNoWorkloadStampPath>$(SdkWithNoWorkloadForTestingPath)version-$(SdkVersionForWorkloadTesting).stamp</SdkWithNoWorkloadStampPath>
<SdkWithNoWorkload_WorkloadStampPath>$(SdkWithNoWorkloadForTestingPath)workload.stamp</SdkWithNoWorkload_WorkloadStampPath>

<SdkWithWorkloadForTestingPath Condition="'$(TargetOS)' == 'browser'">$(ArtifactsBinDir)dotnet-net7+latest\</SdkWithWorkloadForTestingPath>
<SdkWithWorkloadForTestingPath Condition="'$(TargetOS)' == 'browser'">$(ArtifactsBinDir)dotnet-latest\</SdkWithWorkloadForTestingPath>
<SdkWithWorkloadForTestingPath Condition="'$(TargetOS)' == 'wasi'">$(ArtifactsBinDir)dotnet-latest\</SdkWithWorkloadForTestingPath>
<SdkWithWorkloadForTestingPath Condition="'$(SdkWithWorkloadForTestingPath)' != ''">$([MSBuild]::NormalizeDirectory($(SdkWithWorkloadForTestingPath)))</SdkWithWorkloadForTestingPath>

Expand Down
2 changes: 1 addition & 1 deletion src/libraries/sendtohelixhelp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

<FailOnTestFailure Condition="'$(FailOnTestFailure)' == '' and '$(WaitForWorkItemCompletion)' != ''">$(WaitForWorkItemCompletion)</FailOnTestFailure>

<SdkForWorkloadTestingDirName Condition="'$(SdkForWorkloadTestingDirName)' == '' and '$(NeedsWorkload)' == 'true' and '$(TestUsingWorkloads)' == 'true'">dotnet-net7+latest</SdkForWorkloadTestingDirName>
<SdkForWorkloadTestingDirName Condition="'$(SdkForWorkloadTestingDirName)' == '' and '$(NeedsWorkload)' == 'true' and '$(TestUsingWorkloads)' == 'true'">dotnet-latest</SdkForWorkloadTestingDirName>
<SdkForWorkloadTestingDirName Condition="'$(SdkForWorkloadTestingDirName)' == '' and '$(NeedsWorkload)' == 'true' and '$(TestUsingWorkloads)' != 'true'">dotnet-none</SdkForWorkloadTestingDirName>
</PropertyGroup>

Expand Down

0 comments on commit 967250c

Please sign in to comment.