Skip to content

Commit

Permalink
fix: fix xvfb-run
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Mar 4, 2024
1 parent 4db2b85 commit 87eee40
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ecosystem-ci-selected.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ jobs:
- run: pnpm --version
- run: pnpm i --frozen-lockfile
- run: >-
xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24'
pnpm tsx ecosystem-ci.ts
--${{ inputs.refType }} ${{ inputs.ref }}
--repo ${{ inputs.repo }}
Expand Down
16 changes: 9 additions & 7 deletions tests/vitest-vscode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runInRepo, $ } from '../utils'
import { runInRepo, cwd } from '../utils'
import { RunOptions } from '../types'
import process from 'node:process'

Expand All @@ -8,12 +8,14 @@ export async function test(options: RunOptions) {
build: 'compile',
repo: 'vitest-dev/vscode',
test: async () => {
await $`pnpm test`
// if (process.env.CI === 'true' && process.platform === 'linux') {
// await $`xvfb-run --auto-servernum --server-args="-screen\\ 0\\ 1024x768x24" pnpm test`
// } else {
// await $`pnpm test`
// }
// use execa directly since utils' wrapper seems to have problems with escaping
const { $: $_ } = await import('execa')
const $ = $_({ stdio: 'inherit', cwd })
if (process.env.CI === 'true' && process.platform === 'linux') {
await $`xvfb-run --auto-servernum ${'--server-args=-screen 0 1920x1080x24'} pnpm test`
} else {
await $`pnpm test`
}
},

// https://github.com/vitest-dev/vscode/pull/276
Expand Down
2 changes: 1 addition & 1 deletion utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import * as semver from 'semver'
const isGitHubActions = !!process.env.GITHUB_ACTIONS

let vitestPath: string
let cwd: string
export let cwd: string
let env: ProcessEnv

const VITEST_SUB_PACKAGES = [
Expand Down

0 comments on commit 87eee40

Please sign in to comment.