Skip to content

Commit

Permalink
Correctly pass --py2 or --py3 to some Azure Pipeline tasks (#27199)
Browse files Browse the repository at this point in the history
We had incorrectly assumed that all Azure Pipeline VMs had access to
Python 2, but that isn't true (the Edge run VMs only have Py3 nowadays).
As such, update_hosts.yml and update_manifest.yml broke on those VMs.

Instead, make the pyflag a variable for those yml files and set it
appropriately.
  • Loading branch information
stephenmcgruer committed Jan 15, 2021
1 parent 36789d9 commit 262bf7f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .azure-pipelines.yml
Expand Up @@ -233,7 +233,11 @@ jobs:
- template: tools/ci/azure/install_chrome.yml
- template: tools/ci/azure/install_firefox.yml
- template: tools/ci/azure/update_hosts.yml
parameters:
pyflag: --py2
- template: tools/ci/azure/update_manifest.yml
parameters:
pyflag: --py2
- template: tools/ci/azure/tox_pytest.yml
parameters:
directory: tools/wpt/
Expand Down Expand Up @@ -403,7 +407,11 @@ jobs:
# - template: tools/ci/azure/install_chrome.yml
# - template: tools/ci/azure/install_firefox.yml
- template: tools/ci/azure/update_hosts.yml
parameters:
pyflag: --py2
- template: tools/ci/azure/update_manifest.yml
parameters:
pyflag: --py2
- template: tools/ci/azure/tox_pytest.yml
parameters:
directory: tools/wpt/
Expand Down
5 changes: 4 additions & 1 deletion tools/ci/azure/update_hosts.yml
@@ -1,10 +1,13 @@
parameters:
pyflag: --py3

steps:
- script: ./wpt make-hosts-file | sudo tee -a /etc/hosts
displayName: 'Update hosts (macOS)'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- powershell: |
$hostFile = "$env:systemroot\System32\drivers\etc\hosts"
Copy-Item -Path $hostFile -Destination "$hostFile.back" -Force
python wpt --py2 make-hosts-file | Out-File $env:systemroot\System32\drivers\etc\hosts -Encoding ascii -Append
python wpt ${{ parameters.pyflag }} make-hosts-file | Out-File $env:systemroot\System32\drivers\etc\hosts -Encoding ascii -Append
displayName: 'Update hosts (Windows)'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
5 changes: 4 additions & 1 deletion tools/ci/azure/update_manifest.yml
@@ -1,4 +1,7 @@
parameters:
pyflag: --py3

steps:
# `python wpt` instead of `./wpt` is to make this work on Windows:
- script: python wpt --py2 manifest
- script: python wpt ${{ parameters.pyflag }} manifest
displayName: 'Update manifest'

0 comments on commit 262bf7f

Please sign in to comment.