From ea2297fd68a8a6fdf51d33e0c2bc4d694ed24048 Mon Sep 17 00:00:00 2001 From: Enson Choy <88302346+echoy-harmonicinc@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:00:42 -0700 Subject: [PATCH] ci: Fix broken Chromedriver (#53) * ci: Fix Chrome tests on Windows in GitHub Actions (#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 (#5618) Specify the explicit path to microsoft-edge on Linux if found, to work around https://github.com/MicrosoftEdge/EdgeWebDriver/issues/102#issuecomment-1710724173 This also incorporates https://github.com/shaka-project/webdriver-installer/pull/35, https://github.com/shaka-project/karma-local-wd-launcher/pull/60, and https://github.com/shaka-project/karma-local-wd-launcher/pull/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 --- .github/workflows/build-and-test.yaml | 26 +++--- build/shaka-lab.yaml | 39 ++++++++- package-lock.json | 121 +++++++++++++++++--------- package.json | 2 +- 4 files changed, 133 insertions(+), 55 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 7f361e0940..4083e3a20d 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -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: @@ -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 diff --git a/build/shaka-lab.yaml b/build/shaka-lab.yaml index a1ea15280d..aa37c4540d 100644 --- a/build/shaka-lab.yaml +++ b/build/shaka-lab.yaml @@ -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 @@ -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 diff --git a/package-lock.json b/package-lock.json index 3a0ed2a722..82b14d004c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "karma-coverage": "^2.2.0", "karma-jasmine": "^4.0.1", "karma-jasmine-ajax": "^0.1.13", - "karma-local-wd-launcher": "^1.6.1", + "karma-local-wd-launcher": "^1.6.6", "karma-opera-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.8", "karma-spec-reporter": "^0.0.34", @@ -4155,7 +4155,7 @@ "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, "dependencies": { "pend": "~1.2.0" @@ -4878,7 +4878,7 @@ "node_modules/if-async": { "version": "3.7.4", "resolved": "https://registry.npmjs.org/if-async/-/if-async-3.7.4.tgz", - "integrity": "sha1-VYaN6wCT08Z79xZudFNT+5vLIaI=", + "integrity": "sha512-BFEH2mZyeF6KZKaKLVPZ0wMjIiWOdjvZ7zbx8ENec0qfZhJwKFbX/4jKM5LTKyJEc/GOqUKiiJ2IFKT9yWrZqA==", "dev": true }, "node_modules/ignore": { @@ -5522,19 +5522,44 @@ "dev": true }, "node_modules/karma-local-wd-launcher": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/karma-local-wd-launcher/-/karma-local-wd-launcher-1.6.1.tgz", - "integrity": "sha512-zgRx1z5ly0tGqJAseDMlFv9iz+AnOgsrYFCqtgt1eLk+fLnrwu7BkM8ZOVJ3kwpjWf8FtNGA6rZ2jExzpg1QeA==", + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/karma-local-wd-launcher/-/karma-local-wd-launcher-1.6.6.tgz", + "integrity": "sha512-8An620Xk5o6o0qVq0ATSgI2xY3+QAzEgrYvwoy4N0eDPzPrCOy99RYPCEOit8XL2AKeOCJ3Q7Puc+mjtBiVwpg==", "dev": true, "dependencies": { "lodash": "^4.17.21", "wd": "^1.14.0", - "webdriver-installer": "^1.1.4" + "webdriver-installer": "^1.1.9", + "which": "^4.0.0" }, "peerDependencies": { "karma": "^6.2.0" } }, + "node_modules/karma-local-wd-launcher/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/karma-local-wd-launcher/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, "node_modules/karma-opera-launcher": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/karma-opera-launcher/-/karma-opera-launcher-1.0.0.tgz", @@ -6595,7 +6620,7 @@ "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, "node_modules/performance-now": { @@ -7010,9 +7035,9 @@ } }, "node_modules/regedit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/regedit/-/regedit-5.0.0.tgz", - "integrity": "sha512-4uSqj6Injwy5TPtXlE+1F/v2lOW/bMfCqNIAXyib4aG1ZwacG69oyK/yb6EF8KQRMhz7YINxkD+/HHc6i7YJtA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/regedit/-/regedit-5.1.2.tgz", + "integrity": "sha512-pQpWqO/I40bMNoMO9kTQx3e5iK542kYcB/Z8X3Y7Hcri6ydc4KZ9ByUsEWFkBRMcwo+2irHuNK5s+pMGPr6VPw==", "dev": true, "dependencies": { "debug": "^4.1.0", @@ -7528,7 +7553,7 @@ "node_modules/stream-slicer": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/stream-slicer/-/stream-slicer-0.0.6.tgz", - "integrity": "sha1-+GsqxcJEC3oKh7cfM2ZcB4gEYTg=", + "integrity": "sha512-QsY0LbweYE5L+e+iBQgtkM5WUIf7+kCMA/m2VULv8rEEDDnlDPsPvOHH4nli6uaZOKQEt64u65h0l/eeZo7lCw==", "dev": true }, "node_modules/streamroller": { @@ -7872,7 +7897,7 @@ "node_modules/through2": { "version": "0.6.5", "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", "dev": true, "dependencies": { "readable-stream": ">=1.0.33-1 <1.1.0-0", @@ -7882,13 +7907,13 @@ "node_modules/through2/node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, "node_modules/through2/node_modules/readable-stream": { "version": "1.0.34", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", "dev": true, "dependencies": { "core-util-is": "~1.0.0", @@ -7900,7 +7925,7 @@ "node_modules/through2/node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", "dev": true }, "node_modules/timm": { @@ -8297,9 +8322,9 @@ } }, "node_modules/webdriver-installer": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/webdriver-installer/-/webdriver-installer-1.1.4.tgz", - "integrity": "sha512-HsGxJi324aHJoH87iABvW8biVyybBz03h0zK0lrmIusBO6GytPM1rdpz1YfoLm3pzUW/vprwleF4GIOeQk2ojw==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/webdriver-installer/-/webdriver-installer-1.1.9.tgz", + "integrity": "sha512-lWoCiOC9LvmGOgsTGCvu4opZxPBA76cPPbp93peSrO3djSLg5C6yDiyeWy+jN4uj3LHISZ5GTfjVOJmCE04OUQ==", "dev": true, "dependencies": { "node-fetch": "^2.6.7", @@ -8556,7 +8581,7 @@ "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, "dependencies": { "buffer-crc32": "~0.2.3", @@ -11661,7 +11686,7 @@ "fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, "requires": { "pend": "~1.2.0" @@ -12196,7 +12221,7 @@ "if-async": { "version": "3.7.4", "resolved": "https://registry.npmjs.org/if-async/-/if-async-3.7.4.tgz", - "integrity": "sha1-VYaN6wCT08Z79xZudFNT+5vLIaI=", + "integrity": "sha512-BFEH2mZyeF6KZKaKLVPZ0wMjIiWOdjvZ7zbx8ENec0qfZhJwKFbX/4jKM5LTKyJEc/GOqUKiiJ2IFKT9yWrZqA==", "dev": true }, "ignore": { @@ -12721,14 +12746,32 @@ } }, "karma-local-wd-launcher": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/karma-local-wd-launcher/-/karma-local-wd-launcher-1.6.1.tgz", - "integrity": "sha512-zgRx1z5ly0tGqJAseDMlFv9iz+AnOgsrYFCqtgt1eLk+fLnrwu7BkM8ZOVJ3kwpjWf8FtNGA6rZ2jExzpg1QeA==", + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/karma-local-wd-launcher/-/karma-local-wd-launcher-1.6.6.tgz", + "integrity": "sha512-8An620Xk5o6o0qVq0ATSgI2xY3+QAzEgrYvwoy4N0eDPzPrCOy99RYPCEOit8XL2AKeOCJ3Q7Puc+mjtBiVwpg==", "dev": true, "requires": { "lodash": "^4.17.21", "wd": "^1.14.0", - "webdriver-installer": "^1.1.4" + "webdriver-installer": "^1.1.9", + "which": "^4.0.0" + }, + "dependencies": { + "isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true + }, + "which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, + "requires": { + "isexe": "^3.1.1" + } + } } }, "karma-opera-launcher": { @@ -13524,7 +13567,7 @@ "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, "performance-now": { @@ -13827,9 +13870,9 @@ } }, "regedit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/regedit/-/regedit-5.0.0.tgz", - "integrity": "sha512-4uSqj6Injwy5TPtXlE+1F/v2lOW/bMfCqNIAXyib4aG1ZwacG69oyK/yb6EF8KQRMhz7YINxkD+/HHc6i7YJtA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/regedit/-/regedit-5.1.2.tgz", + "integrity": "sha512-pQpWqO/I40bMNoMO9kTQx3e5iK542kYcB/Z8X3Y7Hcri6ydc4KZ9ByUsEWFkBRMcwo+2irHuNK5s+pMGPr6VPw==", "dev": true, "requires": { "debug": "^4.1.0", @@ -14234,7 +14277,7 @@ "stream-slicer": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/stream-slicer/-/stream-slicer-0.0.6.tgz", - "integrity": "sha1-+GsqxcJEC3oKh7cfM2ZcB4gEYTg=", + "integrity": "sha512-QsY0LbweYE5L+e+iBQgtkM5WUIf7+kCMA/m2VULv8rEEDDnlDPsPvOHH4nli6uaZOKQEt64u65h0l/eeZo7lCw==", "dev": true }, "streamroller": { @@ -14505,7 +14548,7 @@ "through2": { "version": "0.6.5", "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", "dev": true, "requires": { "readable-stream": ">=1.0.33-1 <1.1.0-0", @@ -14515,13 +14558,13 @@ "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, "readable-stream": { "version": "1.0.34", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -14533,7 +14576,7 @@ "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", "dev": true } } @@ -14840,9 +14883,9 @@ } }, "webdriver-installer": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/webdriver-installer/-/webdriver-installer-1.1.4.tgz", - "integrity": "sha512-HsGxJi324aHJoH87iABvW8biVyybBz03h0zK0lrmIusBO6GytPM1rdpz1YfoLm3pzUW/vprwleF4GIOeQk2ojw==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/webdriver-installer/-/webdriver-installer-1.1.9.tgz", + "integrity": "sha512-lWoCiOC9LvmGOgsTGCvu4opZxPBA76cPPbp93peSrO3djSLg5C6yDiyeWy+jN4uj3LHISZ5GTfjVOJmCE04OUQ==", "dev": true, "requires": { "node-fetch": "^2.6.7", @@ -15036,7 +15079,7 @@ "yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, "requires": { "buffer-crc32": "~0.2.3", diff --git a/package.json b/package.json index 7bb4a0143d..298b7ca8e8 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "karma-coverage": "^2.2.0", "karma-jasmine": "^4.0.1", "karma-jasmine-ajax": "^0.1.13", - "karma-local-wd-launcher": "^1.6.1", + "karma-local-wd-launcher": "^1.6.6", "karma-opera-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.8", "karma-spec-reporter": "^0.0.34",