Build/Test Tools: Add input for disabling AppArmor.

Old branches requiring outdated versions of Chromium to run JavaScript tests have recently started failing as a result of the `ubuntu-latest` container being updated to point to `ubuntu-24`.

This introduces a new input to the reusable JavaScript testing workflow to allow a fix to be used without having to update Chromium or tests in these branches.

Props swissspidy.
See #62808.

git-svn-id: https://develop.svn.wordpress.org/trunk@59635 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2025-01-16 20:19:28 +00:00
parent e114dfb79c
commit fc9aabbc89

View File

@ -5,6 +5,12 @@ name: JavaScript tests
on:
workflow_call:
inputs:
disable-apparmor:
description: 'Whether to disable AppArmor.'
required: false
type: 'boolean'
default: false
jobs:
# Runs the QUnit test suite.
@ -44,6 +50,15 @@ jobs:
- name: Install npm Dependencies
run: npm ci
# Older branches using outdated versions of Puppeteer fail on newer versions of the `ubuntu-24` image.
# This disables AppArmor in order to work around those failures.
#
# See https://issues.chromium.org/issues/373753919
# and https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
- name: Disable AppArmor
if: ${{ inputs.disable-apparmor }}
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Run QUnit tests
run: npm run grunt qunit:compiled