From 4484709b5703ce31928d8ce1475bcff167442d5f Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 11 Dec 2024 10:32:36 -0800 Subject: [PATCH 1/5] Attempt fix on chrome sandbox error on ubuntu 24 --- tests/e2e/puppeteer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/puppeteer.ts b/tests/e2e/puppeteer.ts index 2548b49e3..a93fee37c 100644 --- a/tests/e2e/puppeteer.ts +++ b/tests/e2e/puppeteer.ts @@ -50,7 +50,7 @@ export const connect = () => { }); const browserURL = `http://localhost:${electronDebugPort}` - const browser = output.browser = await puppeteer.launch({ headless: 'new' }) + const browser = output.browser = await puppeteer.launch({ headless: 'new', args: ["--no-sandbox"] }) const page = output.page = await browser.newPage(); await page.goto(browserURL); const endpoint = await page.evaluate(() => fetch(`json/version`).then(res => res.json()).then(res => res.webSocketDebuggerUrl)) From e88c6c73a7cd5535271d4f38d712f6586b7fc5bb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:33:22 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/electron/frontend/assets/css/main.css | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/electron/frontend/assets/css/main.css b/src/electron/frontend/assets/css/main.css index e1d791579..ab90e07c9 100644 --- a/src/electron/frontend/assets/css/main.css +++ b/src/electron/frontend/assets/css/main.css @@ -310,8 +310,8 @@ button[disabled] { padding: 3px 10px; background-color: #fff; font-size: 13px; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, - "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", + sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; } .menu.file { @@ -324,8 +324,8 @@ button[disabled] { background-color: #fff; color: black; font-size: 13px; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, - "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", + sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; } .menu.file li:hover { @@ -355,8 +355,8 @@ button[disabled] { padding: 3px 10px; background-color: #fff; font-size: 13px; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, - "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", + sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; } .menu.reg-folder.off { From ce738190dc2acdec5005ba91726c3f2ee311b72c Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 11 Dec 2024 10:58:08 -0800 Subject: [PATCH 3/5] Fix no sandbox --- tests/e2e/puppeteer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/puppeteer.ts b/tests/e2e/puppeteer.ts index a93fee37c..2cf2d6a1a 100644 --- a/tests/e2e/puppeteer.ts +++ b/tests/e2e/puppeteer.ts @@ -50,7 +50,7 @@ export const connect = () => { }); const browserURL = `http://localhost:${electronDebugPort}` - const browser = output.browser = await puppeteer.launch({ headless: 'new', args: ["--no-sandbox"] }) + const browser = output.browser = await puppeteer.launch({ headless: 'new', args: ["--no-sandbox", "--disable-setuid-sandbox"] }) const page = output.page = await browser.newPage(); await page.goto(browserURL); const endpoint = await page.evaluate(() => fetch(`json/version`).then(res => res.json()).then(res => res.webSocketDebuggerUrl)) From 0723ea3251e0cf99ae3a309e1890bb73bf2f0356 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 11 Dec 2024 10:58:59 -0800 Subject: [PATCH 4/5] Add comment --- tests/e2e/puppeteer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/puppeteer.ts b/tests/e2e/puppeteer.ts index 2cf2d6a1a..a51cda6c9 100644 --- a/tests/e2e/puppeteer.ts +++ b/tests/e2e/puppeteer.ts @@ -50,6 +50,7 @@ export const connect = () => { }); const browserURL = `http://localhost:${electronDebugPort}` + // See notes on no sandbox mode: https://pptr.dev/troubleshooting#setting-up-chrome-linux-sandbox const browser = output.browser = await puppeteer.launch({ headless: 'new', args: ["--no-sandbox", "--disable-setuid-sandbox"] }) const page = output.page = await browser.newPage(); await page.goto(browserURL); From 0768f6fed0d66eb0dd7543b3928d14ed4de99de9 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 11 Dec 2024 12:17:49 -0800 Subject: [PATCH 5/5] Change local sandbox permissions --- .github/workflows/testing_dev_e2e_with_live_services.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing_dev_e2e_with_live_services.yml b/.github/workflows/testing_dev_e2e_with_live_services.yml index 8367a8df7..6778d5bf3 100644 --- a/.github/workflows/testing_dev_e2e_with_live_services.yml +++ b/.github/workflows/testing_dev_e2e_with_live_services.yml @@ -86,7 +86,12 @@ jobs: - if: matrix.os == 'ubuntu-latest' name: Run tests with xvfb - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run coverage:tutorial + run: | + # Adjust Chrome sandbox (used by Puppeteer) owner and permissions to bypass Ubuntu 24.04's + # new restrictions for AppImage apps. https://github.com/electron/electron/issues/42510 + sudo chown root ./node_modules/electron/dist/chrome-sandbox + sudo chmod 4755 ./node_modules/electron/dist/chrome-sandbox + xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run coverage:tutorial - name: Archive E2E Test Screenshots uses: actions/upload-artifact@v4