Skip to content

Commit ac4d292

Browse files
Fix Electron launch in CI with --no-sandbox flag
Add --no-sandbox and --disable-gpu flags when running in CI environments to avoid sandboxing issues in containers. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3339571 commit ac4d292

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

electron/tests/accessibility.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,14 @@ async function runAccessibilityTests() {
6767
path.join(__dirname, "..", "dist", "main", "main.js"),
6868
);
6969

70-
// Launch Electron app
70+
// Launch Electron app (--no-sandbox needed for CI/container environments)
71+
const isCI = process.env.CI === "true" || process.env.CI === true;
7172
const electronApp = await electron.launch({
7273
executablePath: electronPath,
73-
args: [path.join(__dirname, "..", "dist", "main", "main.js")],
74+
args: [
75+
path.join(__dirname, "..", "dist", "main", "main.js"),
76+
...(isCI ? ["--no-sandbox", "--disable-gpu"] : []),
77+
],
7478
env: {
7579
...process.env,
7680
NODE_ENV: "test",

0 commit comments

Comments
 (0)