-
Notifications
You must be signed in to change notification settings - Fork 2k
[net11.0] Use Helix job monitor for unit tests #37852
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,9 @@ parameters: | |
| default: | ||
| - Debug | ||
| - Release | ||
| - name: helixJobMonitorTimeoutInMinutes | ||
| type: number | ||
| default: 360 | ||
| - name: helixPool | ||
| type: object | ||
|
|
||
|
|
@@ -91,9 +94,65 @@ stages: | |
| DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) | ||
| PRIVATE_BUILD: $(PrivateBuild) | ||
|
|
||
| - script: $(_msbuildCommand) "${{ parameters.helixProject }}" -warnAsError 0 -restore /p:Configuration=${{ BuildConfiguration }} /p:HelixInternal="${{ parameters.helixInternal }}" /p:TestRunNameSuffix="_${{ BuildConfiguration }}" /p:SkipInitInternalTooling=true /bl:$(Build.Arcade.LogsPath)${{ BuildConfiguration }}/helix_tests.binlog ${{ parameters.extraHelixArguments }} | ||
| - script: $(_msbuildCommand) "${{ parameters.helixProject }}" -warnAsError 0 -restore /p:Configuration=${{ BuildConfiguration }} /p:EnableHelixJobMonitor=true /p:HelixInternal="${{ parameters.helixInternal }}" /p:TestRunNameSuffix="_${{ BuildConfiguration }}" /p:SkipInitInternalTooling=true /bl:$(Build.Arcade.LogsPath)${{ BuildConfiguration }}/helix_tests.binlog ${{ parameters.extraHelixArguments }} | ||
| displayName: Run Helix Tests | ||
| env: | ||
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops | ||
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
| HelixAccessToken: ${{ parameters.HelixAccessToken }} | ||
|
|
||
|
|
||
| - job: HelixJobMonitor | ||
| displayName: Monitor Helix Jobs | ||
| timeoutInMinutes: ${{ parameters.helixJobMonitorTimeoutInMinutes }} | ||
| pool: | ||
| ${{ if eq(variables['System.TeamProject'], 'public') }}: | ||
| name: $(DncEngPublicBuildPool) | ||
| demands: ImageOverride -equals build.azurelinux.3.amd64.open | ||
| ${{ else }}: | ||
| name: $(DncEngInternalBuildPool) | ||
| demands: ImageOverride -equals build.azurelinux.3.amd64 | ||
| steps: | ||
| - checkout: self | ||
| fetchDepth: 1 | ||
|
|
||
| - bash: | | ||
| set -euo pipefail | ||
|
|
||
| toolPath="$AGENT_TEMPDIRECTORY/helix-job-monitor" | ||
| bash ./eng/common/dotnet.sh | ||
| toolVersion=$(bash ./eng/common/dotnet.sh msbuild eng/Versions.props -getProperty:MicrosoftDotNetHelixSdkPackageVersion -nologo | tail -n 1) | ||
| if [[ -z "$toolVersion" || "$toolVersion" =~ [[:space:]] ]]; then | ||
| echo "Could not read the Helix SDK package version from eng/Versions.props." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| bash ./eng/common/dotnet.sh tool install \ | ||
| --tool-path "$toolPath" \ | ||
| Microsoft.DotNet.Helix.JobMonitor \ | ||
| --version "$toolVersion" | ||
|
|
||
| toolDll=$(find "$toolPath/.store" -path '*/tools/*/any/Microsoft.DotNet.Helix.JobMonitor.dll' -type f -print -quit) | ||
| if [ ! -f "$toolDll" ]; then | ||
| echo "Could not find the Helix Job Monitor DLL in '$toolPath/.store'." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "##vso[task.setvariable variable=HelixJobMonitorDll]$toolDll" | ||
| displayName: Install Helix Job Monitor | ||
|
|
||
| - bash: | | ||
| set -euo pipefail | ||
|
|
||
| bash ./eng/common/dotnet.sh exec "$(HelixJobMonitorDll)" \ | ||
|
Comment on lines
+133
to
+145
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The DLL invocation is intentional and matches the canonical Arcade template’s isolated-package path: it runs the net11-targeted tool through MAUI’s pinned repo-local SDK. Invoking the shim directly would delegate runtime selection to the host environment, which is exactly what this job must avoid before/around SDK bootstrapping. The exact pinned package layout was also exercised successfully in builds 1568946 and 1569038. |
||
| --helix-base-uri 'https://helix.dot.net/' \ | ||
| --polling-interval-seconds 30 \ | ||
| --fail-on-failed-tests true \ | ||
| --max-wait-minutes "$((${{ parameters.helixJobMonitorTimeoutInMinutes }} - 5))" \ | ||
|
Comment on lines
+145
to
+149
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate of the timeout-contract comment above. The configured value is 360, there are no overrides, and silently clamping an invalid <=5-minute job timeout would not preserve the shutdown invariant. |
||
| --stage-name '$(System.StageName)' \ | ||
| --organization dotnet \ | ||
| --repository maui \ | ||
| --build-reason '$(Build.Reason)' \ | ||
| --source-branch '$(Build.SourceBranch)' | ||
| displayName: Monitor Helix Jobs | ||
| env: | ||
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pinned Job Monitor reads |
||
| HELIX_ACCESSTOKEN: ${{ parameters.HelixAccessToken }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter follows the canonical Arcade monitor template contract and defaults to 360 minutes; MAUI has no caller overriding it. Clamping a deliberately invalid job timeout would be misleading because a <=5-minute Azure job cannot preserve the required five-minute graceful-shutdown window. No change is needed for the configured path.