Skip to content

Commit

Permalink
[ci] Execute build.ps1 from bash on Mac to avoid STDIO streams hang (#…
Browse files Browse the repository at this point in the history
…19257)

* Use Start-Process to run build.ps1

* Show Start-Process command

* Fix: Comma separator prior to -Script argument

* Dedicated .cake parameter setting for -Script

* Fix: Start-Process: Start 3rd parameter with a quote and not an escaped quote

* Execute build.ps1 under pwsh in bash

* Remove references to Start-Process since that solution did not work

* Execute build.ps1 from bash on Mac only
  • Loading branch information
mjbond-msft authored and PureWeen committed Dec 13, 2023
1 parent 2b77991 commit aae067e
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion eng/pipelines/common/device-tests-steps.yml
Expand Up @@ -55,9 +55,30 @@ steps:
- pwsh: ./build.ps1 --target=dotnet-buildtasks --configuration="Release"
displayName: 'Build the MSBuild Tasks'

- pwsh: ./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }}
- pwsh: |
$platformName = 'Windows'
if ($IsMacOS) {
$platformName = 'Mac'
} elseif ($IsLinux) {
$platformName = 'Linux'
}
Write-Host "Platform.Name: ${platformName}"
Write-Host "##vso[task.setvariable variable=Platform.Name]${platformName}"
displayName: 'Set Platform.Name'
- pwsh: |
./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }}
displayName: $(Agent.JobName)
workingDirectory: ${{ parameters.checkoutDirectory }}
condition: and(succeeded(), ne(variables['Platform.Name'], 'Mac'))
retryCountOnTaskFailure: 2
- bash: |
# Execute the powershell script from a bash shell on Mac to avoid interference between powershell processes that lead to this error: The STDIO streams did not close within 10 seconds of the exit event from process '/usr/local/bin/pwsh'. This may indicate a child process inherited the STDIO streams and has not yet exited.
pwsh ./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }}
displayName: $(Agent.JobName)
workingDirectory: ${{ parameters.checkoutDirectory }}
condition: and(succeeded(), eq(variables['Platform.Name'], 'Mac'))
retryCountOnTaskFailure: 2
- task: PublishTestResults@2
Expand Down

0 comments on commit aae067e

Please sign in to comment.