Skip to content

Commit 073d67e

Browse files
committed
Run xvfb in the background directly
1 parent 7ad1078 commit 073d67e

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
matrix:
2020
os:
2121
- macos-latest
22-
# Testing on Linux is temporarily disabled until we can figure out the SUID sandboxing issue.
23-
# - ubuntu-latest
22+
- ubuntu-latest
2423
- windows-latest
2524
runs-on: ${{ matrix.os }}
2625
steps:
@@ -49,10 +48,21 @@ jobs:
4948
if: steps.cache.outputs.cache-hit != 'true'
5049
run: npm install
5150

51+
- name: Linux workarounds
52+
if: runner.os == 'Linux'
53+
run: |
54+
sudo chown root:root $SANDBOX_BIN
55+
sudo chmod 4755 $SANDBOX_BIN
56+
Xvfb :99 &
57+
env:
58+
SANDBOX_BIN: ./node_modules/electron/dist/chrome-sandbox
59+
5260
- name: Run tests
5361
run: |
5462
composer run assets --working-dir=build
5563
npm run test
64+
env:
65+
DISPLAY: :99
5666

5767
- uses: actions/upload-artifact@v4
5868
if: ${{ !cancelled() }}

tests/main.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ async function launchApp(testInfo: TestInfo, ...options: string[]): Promise<[Ele
2121
COMPOSER_MIRROR_PATH_REPOS: '1',
2222
// Disable the network so we don't inadvertently test the internet.
2323
COMPOSER_DISABLE_NETWORK: '1',
24+
// For xvfb on Linux.
25+
DISPLAY: process.env.DISPLAY || '',
2426
},
2527
});
2628
return [app, root];

0 commit comments

Comments
 (0)