Skip to content

Commit

Permalink
ci: Fix broken Chromedriver (#53)
Browse files Browse the repository at this point in the history
* ci: Fix Chrome tests on Windows in GitHub Actions (shaka-project#5548)

GitHub started installing "Chrome for Testing" builds on Windows and
Mac. Unfortunately, these builds don't have support for H264 and AAC
codecs, which we need in our tests.

This fixes the issue by explicitly installing an official build of
Chrome on Windows, to overwrite the "Chrome for Testing" build.
# Conflicts:
#	.github/workflows/build-and-test.yaml

* ci: Work around msedgedriver 115+ bug (shaka-project#5618)

Specify the explicit path to microsoft-edge on Linux if found, to work around MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35, shaka-project/karma-local-wd-launcher#60, and shaka-project/karma-local-wd-launcher#62 to revert earlier workarounds and apply new ones for local test runs.
# Conflicts:
#	build/shaka-lab.yaml
#	package-lock.json
#	package.json

---------

Co-authored-by: Joey Parrish <[email protected]>
  • Loading branch information
echoy-harmonicinc and joeyparrish authored Sep 27, 2023
1 parent ae35c88 commit ea2297f
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 55 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,6 @@ jobs:
if: matrix.os == 'ubuntu-latest' && matrix.browser == 'Firefox'
run: sudo apt -y update && sudo apt -y install ffmpeg

# Edge 107 fails DRM tests due to an outdated Widevine CDM. Force Edge
# to update to 108+.
- name: Upgrade Edge
if: matrix.os == 'ubuntu-latest' && matrix.browser == 'Edge'
run: |
# If it's Edge 107, update it. Otherwise, don't. This way, we don't
# break something later when Edge 108+ is available by default in
# GitHub Actions.
if apt show microsoft-edge-stable | grep -q '^Version: 107'; then
wget https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_108.0.1462.46-1_amd64.deb
sudo dpkg -i microsoft-edge-stable_108.0.1462.46-1_amd64.deb
fi
- name: Checkout code
uses: actions/checkout@v3
with:
Expand All @@ -127,6 +114,19 @@ jobs:
# Install a launcher that can execute a shell script to launch this
npm install karma-script-launcher --save-dev
# When "Chrome for Testing" is installed on Mac or Windows, it gets
# invoked instead of simply "Chrome". This other copy of Chrome,
# however, doesn't seem to have basic codecs like AAC and H264 available,
# causing many of our test scenarios to fail. Deleting "Chrome for
# Testing" fixes this.
- name: 'Delete "Chrome for Testing" on Mac'
if: matrix.os == 'macos-latest' && matrix.browser == 'Chrome'
run: sudo rm -rf /Applications/Google\ Chrome\ for\ Testing.app
- name: 'Overwrite "Chrome for Testing" on Windows'
if: matrix.os == 'windows-latest' && matrix.browser == 'Chrome'
shell: bash
run: choco install -y googlechrome --ignore-checksums

# Some CI images (self-hosted or otherwise) don't have the minimum Java
# version necessary for the compiler (Java 11).
- uses: actions/setup-java@v3
Expand Down
39 changes: 37 additions & 2 deletions build/shaka-lab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,31 @@ vars:
excludeSwitches:
- "disable-component-update"

chrome_android_config: &chrome_android_config
basic_edge_config: &basic_edge_config
ms:edgeOptions:
args:
# Normally, Edge disallows autoplaying videos in many cases. Enable it
# for testing.
- "--autoplay-policy=no-user-gesture-required"
# Disable browser features that try to save power by suspending media,
# throttling timers, etc.
- "--disable-background-media-suspend"
- "--disable-background-timer-throttling"
- "--disable-backgrounding-occluded-windows"

# Instruct edgedriver not to disable component updater. The component
# updater must run in order for the Widevine CDM to be available when
# using a new user-data-dir.
excludeSwitches:
- "disable-component-update"

# Work around https://github.com/MicrosoftEdge/EdgeWebDriver/issues/102#issuecomment-1710724173
# by specifying the binary path on Linux.
edge_linux_config: &edge_linux_config
ms:edgeOptions:
binary: /usr/bin/microsoft-edge

android_chrome_config: &android_chrome_config
goog:chromeOptions:
args: *minimum_chrome_android_args

Expand Down Expand Up @@ -137,7 +161,18 @@ ChromeLinux:
FirefoxLinux:
browser: firefox
os: Linux
extra_config: *firefox_config
extra_configs:
- *basic_firefox_config

EdgeLinux:
browser: msedge
os: Linux
extra_configs:
- *basic_edge_config
- *edge_linux_config


### Misc ###

ChromeAndroid:
browser: chrome
Expand Down
121 changes: 82 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ea2297f

Please sign in to comment.