Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit d4d148e

Browse files
committed
solidify integration test runs
1 parent 0ce6391 commit d4d148e

File tree

3 files changed

+12
-27
lines changed

3 files changed

+12
-27
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,23 @@ on:
77
branches: [main]
88
workflow_dispatch:
99

10-
# env:
11-
# DEBUG: pw:*
12-
1310
jobs:
1411
test:
1512
strategy:
1613
fail-fast: false
1714
matrix:
1815
os: [ubuntu-latest, windows-latest, macos-latest]
1916
runs-on: ${{ matrix.os }}
20-
env:
21-
SKIP_INTEGRATION: ${{ matrix.os != 'ubuntu-latest' }}
2217
steps:
2318
- uses: actions/checkout@v2
2419
- uses: actions/setup-node@v2
2520
with:
2621
# https://github.com/actions/setup-node#supported-version-syntax
2722
node-version: "lts/*"
28-
- run: npm i -g pnpm
29-
- run: pnpm i
30-
31-
- name: Run Xvfb
32-
if: ${{ matrix.os == 'ubuntu-latest' }}
33-
run: |
34-
export DISPLAY=':99.0'
35-
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
23+
- run: npm install --global pnpm
24+
- run: pnpm install
3625

3726
- name: Test
38-
run: pnpm test
27+
uses: GabrielBB/xvfb-action@v1
28+
with:
29+
run: pnpm test

tests/build.test.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,27 @@ import { afterAll, beforeAll, expect, test } from "vitest"
66
import { defineIntegration } from "./define-integration"
77

88
defineIntegration(() => {
9+
if (process.platform !== "linux") {
10+
console.info("Skipping build test on non-linux platform")
11+
return
12+
}
13+
914
const appFolder = join(__dirname, "../template")
1015

1116
let electronApp: ElectronApplication
1217
let window: Page
1318

1419
beforeAll(async () => {
15-
await execa("pnpm", ["build", "--", "--dir"], {
20+
await execa("pnpm", ["run", "build", "--", "--dir"], {
1621
cwd: appFolder,
1722
})
1823

1924
electronApp = await electron.launch({
20-
cwd: appFolder,
21-
args: ["."],
25+
// TODO: figure out what the executablePath is for other platforms
2226
executablePath: join(
2327
appFolder,
2428
"dist/linux-unpacked/remix-electron-template",
2529
),
26-
27-
// this fixes a failure to launch on linux
28-
env: {
29-
DISPLAY: process.env.DISPLAY!,
30-
},
3130
})
3231

3332
window = await electronApp.firstWindow()

tests/integration.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ defineIntegration(() => {
1919
electronApp = await electron.launch({
2020
cwd: appFolder,
2121
args: ["."],
22-
23-
// this fixes a failure to launch on linux
24-
env: {
25-
DISPLAY: process.env.DISPLAY!,
26-
},
2722
})
2823

2924
window = await electronApp.firstWindow()

0 commit comments

Comments
 (0)