Skip to content
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

Make --py3 the default for 'wpt' #27081

Merged
merged 1 commit into from Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-pipelines.yml
Expand Up @@ -97,7 +97,7 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7.x'
versionSpec: '3.8.x'
- template: tools/ci/azure/checkout.yml
- template: tools/ci/azure/pip_install.yml
parameters:
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/azure/update_hosts.yml
Expand Up @@ -5,6 +5,6 @@ steps:
- powershell: |
$hostFile = "$env:systemroot\System32\drivers\etc\hosts"
Copy-Item -Path $hostFile -Destination "$hostFile.back" -Force
python wpt make-hosts-file | Out-File $env:systemroot\System32\drivers\etc\hosts -Encoding ascii -Append
python wpt --py2 make-hosts-file | Out-File $env:systemroot\System32\drivers\etc\hosts -Encoding ascii -Append
jgraham marked this conversation as resolved.
Show resolved Hide resolved
displayName: 'Update hosts (Windows)'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
2 changes: 1 addition & 1 deletion tools/ci/azure/update_manifest.yml
@@ -1,4 +1,4 @@
steps:
# `python wpt` instead of `./wpt` is to make this work on Windows:
- script: python wpt manifest
- script: python wpt --py2 manifest
jgraham marked this conversation as resolved.
Show resolved Hide resolved
displayName: 'Update manifest'
12 changes: 4 additions & 8 deletions tools/ci/ci_wptrunner_infrastructure.sh
Expand Up @@ -6,22 +6,18 @@ WPT_ROOT=$SCRIPT_DIR/../..
cd $WPT_ROOT

test_infrastructure() {
PY3_FLAG="$2"
TERM=dumb ./wpt $PY3_FLAG run --log-mach - --yes --manifest ~/meta/MANIFEST.json --metadata infrastructure/metadata/ --install-fonts --install-webdriver $1 $PRODUCT infrastructure/
PY2_FLAG="$2"
TERM=dumb ./wpt $PY2_FLAG run --log-mach - --yes --manifest ~/meta/MANIFEST.json --metadata infrastructure/metadata/ --install-fonts --install-webdriver $1 $PRODUCT infrastructure/
}

main() {
if [[ $# -eq 1 && "$1" = "--py3" ]]; then
PRODUCTS=( "chrome" )
else
PRODUCTS=( "firefox" "chrome" )
fi
PRODUCTS=( "firefox" "chrome" )
./wpt manifest --rebuild -p ~/meta/MANIFEST.json
for PRODUCT in "${PRODUCTS[@]}"; do
if [[ "$PRODUCT" == "chrome" ]]; then
test_infrastructure "--binary=$(which google-chrome-unstable) --channel dev" "$1"
else
test_infrastructure "--binary=~/build/firefox/firefox"
test_infrastructure "--binary=~/build/firefox/firefox" "$1"
fi
done
}
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/tc/decision.py
Expand Up @@ -138,7 +138,7 @@ def get_fetch_rev(event):
if not output:
logger.error("Failed to get commit for %s" % ref)
else:
sha = output.split()[0]
sha = output.decode("utf-8").split()[0]
rv.append(sha)
rv = tuple(rv)
else:
Expand Down
6 changes: 4 additions & 2 deletions tools/ci/tc/tasks/test.yml
Expand Up @@ -581,7 +581,7 @@ tasks:
- wpt-base
- trigger-pr
- browser-firefox
command: ./tools/ci/ci_wptrunner_infrastructure.sh
command: ./tools/ci/ci_wptrunner_infrastructure.sh --py2
install:
- libnss3-tools
- libappindicator1
Expand All @@ -606,7 +606,8 @@ tasks:
use:
- wpt-base
- trigger-pr
command: ./tools/ci/ci_wptrunner_infrastructure.sh --py3
- browser-firefox
command: ./tools/ci/ci_wptrunner_infrastructure.sh
install:
- python3-pip
- libnss3-tools
Expand All @@ -615,6 +616,7 @@ tasks:
options:
oom-killer: true
browser:
- firefox
- chrome
channel: experimental
xvfb: true
Expand Down
2 changes: 1 addition & 1 deletion wpt
Expand Up @@ -20,7 +20,7 @@ if __name__ == "__main__":
sys.exit(1)
else:
raise
elif (args.py3 or py3only) and sys.version_info.major < 3:
elif (not args.py2) and sys.version_info.major < 3:
from subprocess import call
try:
sys.exit(call(['python3'] + sys.argv))
Expand Down