diff --git a/test/e2e/context.ts b/test/e2e/context.ts index c190dc1b..028482d2 100644 --- a/test/e2e/context.ts +++ b/test/e2e/context.ts @@ -1,3 +1,4 @@ +import { parseSemver } from '@sentry/utils'; import { ChildProcess, spawn, spawnSync } from 'child_process'; import { rmSync } from 'fs'; import { homedir } from 'os'; @@ -47,6 +48,7 @@ export class TestContext { */ public constructor( private readonly _electronPath: string, + private readonly _electronVersion: string, private readonly _appPath: string, private readonly _appName: string, ) {} @@ -66,7 +68,15 @@ export class TestContext { this._clearAppUserData(); } - const childProcess = spawn(this._electronPath, [this._appPath], { env }); + const version = parseSemver(this._electronVersion); + + const args = [this._appPath]; + // Older versions of Electron no longer work correctly on 'ubuntu-latest' with sandbox + if (process.platform === 'linux' && (version.major || 0) < 13) { + args.push('--no-sandbox'); + } + + const childProcess = spawn(this._electronPath, args, { env }); function logLinesWithoutEmpty(input: string): void { input diff --git a/test/e2e/index.test.ts b/test/e2e/index.test.ts index 550a003a..5554756e 100644 --- a/test/e2e/index.test.ts +++ b/test/e2e/index.test.ts @@ -61,7 +61,7 @@ describe('E2E Tests', () => { } const [appPath, appName] = await recipe.prepare(this, distDir); - testContext = new TestContext(await electronPath, appPath, appName); + testContext = new TestContext(await electronPath, electronVersion, appPath, appName); await recipe.runTests(testContext, testServer); }); } @@ -79,7 +79,7 @@ describe('E2E Tests', () => { } const [appPath, appName] = await recipe.prepare(this, distDir); - testContext = new TestContext(await electronPath, appPath, appName); + testContext = new TestContext(await electronPath, electronVersion, appPath, appName); await recipe.runTests(testContext, testServer); }); }