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

ci: Enable testing on Linux arm64 #199

Merged
merged 3 commits into from
Nov 10, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
#!/bin/bash
exec /usr/bin/chromium --no-sandbox "\$@"
EOF

chmod 755 /usr/local/bin/chromium
echo "CHROME_BIN=/usr/local/bin/chromium" >> $GITHUB_ENV

- name: Install Python deps
run: |
python3 -m pip install -r requirements.txt
Expand Down Expand Up @@ -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/[email protected]
Expand Down
1 change: 0 additions & 1 deletion build-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions run_end_to_end_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' +
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions tests/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = function(config) {
filter: config.filter,
seed: config.seed,
debug: !!config.debug,
testWidevine: !!config.testWidevine,
},
frameworks: ['jasmine'],
files: [
Expand Down
9 changes: 8 additions & 1 deletion tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down Expand Up @@ -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': [
Expand Down
Loading