diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 9e778fe..8d80eb4 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -112,6 +112,23 @@ jobs: libva2 libva-drm2 \ nodejs npm xvfb + - name: Install Chromium (non-Snap, arm64 Linux only) + if: runner.os == 'Linux' && matrix.target_arch == 'arm64' + run: | + sudo add-apt-repository ppa:xtradeb/apps -y + sudo apt update + sudo apt -y install chromium + + # Running inside a Docker container, we need to kill the sandbox. + # Heredocs interpolate variables, so escape the dollar sign below. + cat >/usr/local/bin/chromium <> $GITHUB_ENV + - name: Install Python deps run: | python3 -m pip install -r requirements.txt @@ -142,8 +159,20 @@ jobs: else WRAPPER="" fi + + if [[ '${{ runner.os }}' == 'Linux' && '${{ matrix.target_arch }}' == 'arm64' ]]; then + # There is no Widevine CDM for Linux arm64 at this time. + # By setting this here instead of probing during the test, we can + # be sure to notice failures if Widevine disappears from our + # testing environment on platforms where this would not be + # expected. + EXTRA_ARGS="--no-test-widevine" + else + EXTRA_ARGS="" + fi + # Use the "spec" reporter for clearer logs in GitHub Actions - $WRAPPER python3 run_end_to_end_tests.py --reporters spec + $WRAPPER python3 run_end_to_end_tests.py --reporters spec $EXTRA_ARGS - name: Debug on failure uses: mxschmitt/action-tmate@v3.6 diff --git a/build-matrix.json b/build-matrix.json index 83d1ca7..b914c64 100644 --- a/build-matrix.json +++ b/build-matrix.json @@ -29,7 +29,6 @@ "comment2": "runners hosted by the owner, enabled by the ENABLE_SELF_HOSTED variable being set on the repo", "selfHosted": [ { - "DISABLED": "Disabled because there is no Chrome build for arm64 Linux to run the test cases. Need support for another browser through Karma.", "os": "self-hosted-linux-arm64", "os_name": "linux", "target_arch": "arm64" diff --git a/run_end_to_end_tests.py b/run_end_to_end_tests.py index c5e5c04..5d55aab 100755 --- a/run_end_to_end_tests.py +++ b/run_end_to_end_tests.py @@ -322,6 +322,12 @@ def main(): help='Random seed to reproduce failures') parser.add_argument('--filter', help='Plain text or regex filter for test cases') + parser.add_argument('--test-widevine', default=True, + action='store_true', + help='Test Widevine (the default)') + parser.add_argument('--no-test-widevine', dest='test_widevine', + action='store_false', + help='Do not test Widevine') parser.add_argument('--debug', action='store_true', help='Dump information about the configs and the ' + @@ -378,6 +384,8 @@ def main(): test_args += [ '--seed', args.seed ] if args.debug: test_args += [ '--debug', 'true' ] + if args.test_widevine: + test_args += [ '--testWidevine', 'true' ] for i in range(trials): # If the exit code was not 0, the tests in karma failed or crashed. diff --git a/tests/karma.conf.js b/tests/karma.conf.js index 3c1ea0f..705f607 100644 --- a/tests/karma.conf.js +++ b/tests/karma.conf.js @@ -22,6 +22,7 @@ module.exports = function(config) { filter: config.filter, seed: config.seed, debug: !!config.debug, + testWidevine: !!config.testWidevine, }, frameworks: ['jasmine'], files: [ diff --git a/tests/tests.js b/tests/tests.js index e5b4d3e..10db879 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -20,6 +20,7 @@ const TEST_DIR = 'test_assets/'; let player; let video; let doDebug = false; +let testWidevine = true; const jasmineEnv = jasmine.getEnv(); const originalJasmineExecute = jasmineEnv.execute.bind(jasmineEnv); @@ -37,6 +38,9 @@ jasmineEnv.execute = () => { // If the user asked us to debug, we can print manifest/playlist contents. doDebug = __karma__.config.debug; + // True if we're testing Widevine (the default). + testWidevine = __karma__.config.testWidevine; + // Set jasmine config. jasmineEnv.configure({ random, @@ -558,13 +562,16 @@ function liveTests(manifestUrl, format) { } function drmTests(manifestUrl, format) { - it('has widevine encryption enabled ' + format, async () => { + it('has Widevine encryption enabled ' + format, async () => { if (manifestUrl.includes('hls.m3u8')) { // https://github.com/shaka-project/shaka-packager/issues/1439 // Inappropriate key material in HLS outputs causes this test to fail. // Until this bug is resolved, skip this test for HLS. pending('Skipped due to shaka-packager#1439'); } + if (!testWidevine) { + pending('Skipped due to command line flag'); + } const inputConfigDict = { 'inputs': [