summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar <oskar@mullvad.net>2024-10-14 11:32:59 +0200
committerOskar <oskar@mullvad.net>2024-10-14 11:32:59 +0200
commit51a902ebc2b88d556dfe7b7c0a5b8def898000b3 (patch)
tree478f5e3d7ba36d342ea4df72f71e667aef9802cd
parentefede4c330ce2337d1a646c733705a3a31239934 (diff)
parent927420ef7c5ae95069f1118f212bab959f71517b (diff)
downloadmullvadvpn-51a902ebc2b88d556dfe7b7c0a5b8def898000b3.tar.xz
mullvadvpn-51a902ebc2b88d556dfe7b7c0a5b8def898000b3.zip
Merge branch 'playwright-tests-fail-in-github-actions-des-1313'
-rw-r--r--.github/workflows/frontend.yml10
-rw-r--r--gui/test/e2e/mocked/mocked-utils.ts12
2 files changed, 20 insertions, 2 deletions
diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml
index fe498ef83f..3b6bc373e4 100644
--- a/.github/workflows/frontend.yml
+++ b/.github/workflows/frontend.yml
@@ -65,7 +65,15 @@ jobs:
shell: bash
run: npm test
- - name: Run Playwright tests
+ - name: Run Playwright tests on Linux
+ if: runner.os == 'Linux'
+ working-directory: gui
+ # The sandbox is disabled as a workaround for lacking userns permisisons which is required
+ # since Ubuntu 24.04.
+ run: NO_SANDBOX=1 npm run e2e:no-build
+
+ - name: Run Playwright tests on Windows
+ if: runner.os != 'Linux'
working-directory: gui
shell: bash
run: npm run e2e:no-build
diff --git a/gui/test/e2e/mocked/mocked-utils.ts b/gui/test/e2e/mocked/mocked-utils.ts
index 57998fae68..2ae14f8c28 100644
--- a/gui/test/e2e/mocked/mocked-utils.ts
+++ b/gui/test/e2e/mocked/mocked-utils.ts
@@ -2,6 +2,10 @@ import { ElectronApplication } from 'playwright';
import { startApp, TestUtils } from '../utils';
+// This option can be removed in the future when/if we're able to tun the tests with the sandbox
+// enabled in GitHub actions (frontend.yml).
+const noSandbox = process.env.NO_SANDBOX === '1';
+
interface StartMockedAppResponse extends Awaited<ReturnType<typeof startApp>> {
util: MockedTestUtils;
}
@@ -12,7 +16,13 @@ export interface MockedTestUtils extends TestUtils {
}
export const startMockedApp = async (): Promise<StartMockedAppResponse> => {
- const startAppResult = await startApp({ args: ['build/test/e2e/setup/main.js'] });
+ const args = ['build/test/e2e/setup/main.js'];
+ if (noSandbox) {
+ console.log('Running tests without chromium sandbox');
+ args.unshift('--no-sandbox');
+ }
+
+ const startAppResult = await startApp({ args });
const mockIpcHandle = generateMockIpcHandle(startAppResult.app);
const sendMockIpcResponse = generateSendMockIpcResponse(startAppResult.app);