Skip to content

Commit b6b826c

Browse files
authored
Update puppeteer / fix tests (#13895)
1 parent 40dc434 commit b6b826c

40 files changed

+1303
-623
lines changed

.github/workflows/tests-e2e.yml

+5
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ jobs:
193193
COMPOSE_INTERACTIVE_NO_CLI: true
194194
WP_VERSION: ${{ matrix.wp }}
195195

196+
# See https://issues.chromium.org/issues/373753919
197+
# and https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
198+
- name: Disable AppArmor
199+
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
200+
196201
- name: Get Chromium executable path
197202
id: chromium_path
198203
run: |

.github/workflows/tests-karma-dashboard.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ jobs:
8181
env:
8282
PUPPETEER_PRODUCT: chrome
8383

84+
# See https://issues.chromium.org/issues/373753919
85+
# and https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
86+
- name: Disable AppArmor
87+
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
88+
8489
# FIXME: https://github.com/googleforcreators/web-stories-wp/issues/4364
8590
- name: Increase max number of file watchers
8691
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@@ -99,6 +104,6 @@ jobs:
99104
- name: Upload code coverage report
100105
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303
101106
with:
102-
file: build/logs/karma-coverage/dashboard/lcov.info
107+
files: build/logs/karma-coverage/dashboard/lcov.info
103108
flags: karmatests
104109
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/tests-karma-editor.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ jobs:
119119
env:
120120
PUPPETEER_PRODUCT: chrome
121121

122+
# See https://issues.chromium.org/issues/373753919
123+
# and https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
124+
- name: Disable AppArmor
125+
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
126+
122127
# FIXME: https://github.com/googleforcreators/web-stories-wp/issues/4364
123128
- name: Increase max number of file watchers
124129
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@@ -140,6 +145,6 @@ jobs:
140145
- name: Upload code coverage report
141146
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303
142147
with:
143-
file: build/logs/karma-coverage/story-editor/lcov.info
148+
files: build/logs/karma-coverage/story-editor/lcov.info
144149
flags: karmatests
145150
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/tests-unit-js.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,6 @@ jobs:
105105
- name: Upload code coverage report
106106
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303
107107
with:
108-
file: build/logs/lcov.info
108+
files: build/logs/lcov.info
109109
flags: unittests
110110
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/tests-unit-php.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,6 @@ jobs:
185185
- name: Upload code coverage report
186186
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303
187187
with:
188-
file: build/logs/*.xml
188+
files: build/logs/*.xml
189189
token: ${{ secrets.CODECOV_TOKEN }}
190190
if: ${{ matrix.coverage }}

jest-puppeteer.config.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
*/
2020
const {
2121
PUPPETEER_DEVTOOLS = false,
22-
PUPPETEER_HEADLESS = 'new',
22+
PUPPETEER_HEADLESS = true,
2323
PUPPETEER_PRODUCT = 'chrome',
2424
PUPPETEER_SLOWMO = 0,
2525
} = process.env;
2626

2727
module.exports = {
2828
launch: {
2929
devtools: PUPPETEER_DEVTOOLS === 'true',
30-
headless: PUPPETEER_HEADLESS !== 'false' ? PUPPETEER_HEADLESS : false,
30+
headless: Boolean(PUPPETEER_HEADLESS),
3131
slowMo: Number(PUPPETEER_SLOWMO) || 0,
3232
product: PUPPETEER_PRODUCT,
3333
args: ['--window-size=1600,1000'], // Same as in percy.config.yml.

karma-dashboard.config.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ module.exports = function (config) {
131131

132132
puppeteerLauncher: {
133133
puppeteer: {
134-
headless: config.headless ? 'new' : false,
134+
headless: Boolean(config.headless),
135135
slowMo: config.slowMo || 0,
136136
devtools: config.devtools || false,
137137
snapshots: config.snapshots || false,

karma-story-editor.config.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ module.exports = function (config) {
143143

144144
puppeteerLauncher: {
145145
puppeteer: {
146-
headless: config.headless ? 'new' : false,
146+
headless: Boolean(config.headless),
147147
slowMo: config.slowMo || 0,
148148
devtools: config.devtools || false,
149149
snapshots: config.snapshots || false,

0 commit comments

Comments
 (0)