Skip to content

Commit fc9aabb

Browse files
committed
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
1 parent e114dfb commit fc9aabb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/reusable-javascript-tests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ name: JavaScript tests
55

66
on:
77
workflow_call:
8+
inputs:
9+
disable-apparmor:
10+
description: 'Whether to disable AppArmor.'
11+
required: false
12+
type: 'boolean'
13+
default: false
814

915
jobs:
1016
# Runs the QUnit test suite.
@@ -44,6 +50,15 @@ jobs:
4450
- name: Install npm Dependencies
4551
run: npm ci
4652

53+
# Older branches using outdated versions of Puppeteer fail on newer versions of the `ubuntu-24` image.
54+
# This disables AppArmor in order to work around those failures.
55+
#
56+
# See https://issues.chromium.org/issues/373753919
57+
# and https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
58+
- name: Disable AppArmor
59+
if: ${{ inputs.disable-apparmor }}
60+
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
61+
4762
- name: Run QUnit tests
4863
run: npm run grunt qunit:compiled
4964

0 commit comments

Comments
 (0)