Testing: disable puppeteer/chrome sandbox in Github Actions for Ubuntu 24.04 (#1657)

--disable-setuid-sandbox deemed acceptable by Yun as it's for Github Actions only
This commit is contained in:
Eoghan Murray
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 955aa8ced0
commit 241ca72f0e
8 changed files with 16 additions and 6 deletions

View File

@@ -0,0 +1,2 @@
---
---

View File

@@ -9,7 +9,7 @@ jobs:
name: Tests
permissions:
contents: read
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

View File

@@ -24,7 +24,7 @@ export async function launchPuppeteer(
width: 1920,
height: 1080,
},
args: ['--no-sandbox'],
args: ['--no-sandbox', '--disable-setuid-sandbox'],
...options,
});
}

View File

@@ -14,7 +14,7 @@ export async function launchPuppeteer(
width: 1920,
height: 1080,
},
args: ['--no-sandbox'],
args: ['--no-sandbox', '--disable-setuid-sandbox'],
...options,
});
}

View File

@@ -1413,7 +1413,9 @@ describe('diff algorithm for rrdom', () => {
* If the selector match is case insensitive, it will cause some CSS style problems in the replayer.
* This test result executed in JSDom is different from that in real browser so we use puppeteer as test environment.
*/
const browser = await puppeteer.launch();
const browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
const page = await browser.newPage();
await page.goto('about:blank');

View File

@@ -242,7 +242,9 @@ describe('RRDocument for browser environment', () => {
let page: puppeteer.Page;
beforeAll(async () => {
browser = await puppeteer.launch();
browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
code = fs.readFileSync(
path.resolve(__dirname, '../dist/rrdom.umd.cjs'),
'utf8',

View File

@@ -103,6 +103,7 @@ describe('integration tests', function (this: ISuite) {
serverURL = getServerURL(server);
browser = await puppeteer.launch({
// headless: false,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
code = fs.readFileSync(
@@ -435,6 +436,7 @@ describe('iframe integration tests', function (this: ISuite) {
serverURL = getServerURL(server);
browser = await puppeteer.launch({
// headless: false,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
code = fs.readFileSync(
@@ -479,6 +481,7 @@ describe('dialog integration tests', function (this: ISuite) {
serverURL = getServerURL(server);
browser = await puppeteer.launch({
// headless: false,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
code = fs.readFileSync(
@@ -525,6 +528,7 @@ describe('shadow DOM integration tests', function (this: ISuite) {
serverURL = getServerURL(server);
browser = await puppeteer.launch({
// headless: false,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
code = fs.readFileSync(

View File

@@ -26,7 +26,7 @@ export async function launchPuppeteer(
width: 1920,
height: 1080,
},
args: ['--no-sandbox'],
args: ['--no-sandbox', '--disable-setuid-sandbox'],
...options,
});
}