Skip to content

Commit

Permalink
Bug 1658561 [wpt PR 24952] - [Azure Pipelines] Use Python 3.8.x for E…
Browse files Browse the repository at this point in the history
…dge test-suite runs, a=testonly

Automatic update from web-platform-tests
[Azure Pipelines] Use Python 3.8.x for Edge test-suite runs (#24952)

See the RFC: web-platform-tests/rfcs#65

This also affects `infrastructure/ tests: Windows 10`, but that job is currently only manually triggered and is basically unused.

Co-authored-by: Mustapha Jaber <mustjabusers.noreply.github.com>
--

wpt-commits: 79c46570895f9a2bf51b812355b93b2fac116318
wpt-pr: 24952

UltraBlame original commit: a27b5f9fc60da817c0a11ce402e816973ccdc831
  • Loading branch information
marco-c committed Dec 3, 2020
1 parent 9275ea9 commit 48d3894
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions testing/web-platform/tests/tools/ci/azure/install_python.yml
@@ -1,15 +1,36 @@
steps:
- powershell: |
Start-BitsTransfer -Source https://www.python.org/ftp/python/2.7.15/python-2.7.15.amd64.msi -Destination python.msi
$hash = (Get-FileHash python.msi).Hash.ToLower()
$expectedHash = "5e85f3c4c209de98480acbf2ba2e71a907fd5567a838ad4b6748c76deb286ad7"
$pythonPath = 'C:\Python38'
$pythonInstallerLogPath = 'python_installer.log'
$installArgs = "/passive /log $pythonInstallerLogPath TargetDir=$pythonPath"
Write-Host "Downloading python installer exe"
$downloadPath = 'python_installer.exe'
Start-BitsTransfer -Source https://www.python.org/ftp/python/3.8.5/python-3.8.5-amd64.exe -Destination $downloadPath
$hash = (Get-FileHash $downloadPath).Hash.ToLower()
$expectedHash = "cd427c7b17337d7c13761ca20877d2d8be661bd30415ddc17072a31a65a91b64"
if ($hash.Equals($expectedHash)) {
Write-Host "python.msi hash verified"
Write-Host "$downloadPath hash verified"
} else {
Throw "python.msi hash mismatch, got $hash, expected $expectedHash"
Throw "$downloadPath hash mismatch, got $hash, expected $expectedHash"
}
msiexec /i python.msi TARGETDIR=C:\Python27 /q
Write-Host "##vso[task.prependpath]C:\Python27"
Write-Host "##vso[task.prependpath]C:\Python27\Scripts"
if (Test-Path -LiteralPath $pythonPath) {
Write-Host "$pythonPath already exists, uninstall it"
$uninstallArgs = $installArgs + " /uninstall /quiet"
$p = Start-Process -FilePath $downloadPath -Verb RunAs -ArgumentList $uninstallArgs -PassThru -Wait
Write-Host "Uninstall finished. Exit code was: $($p.ExitCode)"
}
Write-Host "Running $downloadPath with args $installArgs"
$p = Start-Process -FilePath $downloadPath -Verb RunAs -ArgumentList $installArgs -PassThru -Wait
Write-Host "$downloadPath finished. Exit code was: $($p.ExitCode)"
Write-Host "Adding Python dirs to path"
Write-Host "##vso[task.prependpath]C:\Python38"
Write-Host "##vso[task.prependpath]C:\Python38\Scripts"
Write-Host "Dumping install log file:"
Get-Content -Path "python_installer.log"
displayName: 'Install Python (Windows)'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

0 comments on commit 48d3894

Please sign in to comment.