Skip to content

Commit

Permalink
Pass the binary path of Chrome to wpt run in CI
Browse files Browse the repository at this point in the history
ChromeDriver doesn't honor PATH and uses /opt/google/chrome/chrome by
default (which is usually the stable channel), so we need to explicitly
pass the desired binary path to wpt run (which in turn passes to
chromedriver via capabilities) in Travis CI (both stability check and
infrastructure test).
  • Loading branch information
Hexcles committed Mar 16, 2018
1 parent 750cfaf commit 3b96236
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
9 changes: 6 additions & 3 deletions tools/ci/ci_stability.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ cd $WPT_ROOT
source tools/ci/lib.sh

test_stability() {
./wpt check-stability $PRODUCT --output-bytes $((1024 * 1024 * 3)) --metadata ~/meta/ --install-fonts
local binary_arg=$1
./wpt check-stability $PRODUCT $binary_arg --output-bytes $((1024 * 1024 * 3)) --metadata ~/meta/ --install-fonts
}

main() {
hosts_fixup
local binary_arg=""
if [ $(echo $PRODUCT | grep '^chrome:') ]; then
install_chrome $(echo $PRODUCT | grep --only-matching '\w\+$')
local channel=$(echo $PRODUCT | grep --only-matching '\w\+$')
binary_arg="--binary=$(install_chrome $channel)"
fi
test_stability
test_stability $binary_arg
}

main
9 changes: 6 additions & 3 deletions tools/ci/ci_wptrunner_infrastructure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,25 @@ test_infrastructure() {
local ARGS="";
if [ $PRODUCT == "firefox" ]; then
ARGS="--install-browser"
else
ARGS="--binary=$1"
fi
./wpt run --yes --manifest ~/meta/MANIFEST.json --metadata infrastructure/metadata/ --install-fonts $ARGS $PRODUCT infrastructure/
}

main() {
PRODUCTS=( "firefox" )
PRODUCTS=( "firefox" "chrome" )
for PRODUCT in "${PRODUCTS[@]}"; do
if [ "$PRODUCT" != "firefox" ]; then
# Firefox is expected to work using pref settings for DNS
# Don't adjust the hostnames in that case to ensure this keeps working
hosts_fixup
fi
if [ "$PRODUCT" == "chrome" ]; then
install_chrome dev
test_infrastructure $(install_chrome dev)
else
test_infrastructure
fi
test_infrastructure
done
}

Expand Down
2 changes: 2 additions & 0 deletions tools/ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ install_chrome() {
sudo apt-get install --fix-broken
sudo dpkg --install $deb_archive
fi

echo $(which google-chrome-$channel)
}

0 comments on commit 3b96236

Please sign in to comment.