fix(ci): actually exclude Electron probes from the headless node-server lanes (#26093)

vitest 5 does not apply a CLI --exclude to inline projects, so the glibc floor
container ran profile-state-writer-stall.electron.test.ts and failed with
'spawn xvfb-run ENOENT'. Resolve the selectors to files and filter them before
vitest sees them.
This commit is contained in:
Jinwoo Hong
2026-10-07 03:10:17 -04:00
committed by GitHub
parent 67dc092f18
commit 4077fb4a8d
+12 -9
View File
@@ -1,7 +1,7 @@
// Runs the headless-server suites under the pinned Node (design D4/D4a), not the host's.
import { join, resolve } from 'node:path'
import { randomUUID } from 'node:crypto'
import { readFileSync } from 'node:fs'
import { globSync, readFileSync } from 'node:fs'
import { ORCAD_VERSION_FILENAME } from '../../src/shared/orcad-artifacts.ts'
import { NODE_RUNTIME_PIN } from '../../src/shared/node-runtime-pin.ts'
import {
@@ -11,6 +11,7 @@ import {
import { packagedNodeRuntimePath } from './build-orcad-node.mjs'
import { ensurePinnedNodeExecutable } from './pinned-node-downloads.mjs'
import { currentTarget } from './server-build-target.mjs'
import { UNIT_INCLUDE } from './ci-unit-files.mjs'
import { describeProcessFailure, runProcessSync } from './script-child-process.mjs'
import {
CROSS_RUNTIME_TEST_PATHS,
@@ -84,12 +85,14 @@ run(runtimePath, [
])
function defaultTestArgs() {
return [
...nodeServerTestPaths({ artifact, crossRuntime }),
// Electron probes run in desktop jobs; headless compatibility containers have no display.
'--exclude',
'**/*.electron.test.ts',
// A directory selector would otherwise pull them into lanes that lack their inputs.
...(crossRuntime ? [] : CROSS_RUNTIME_TEST_PATHS.flatMap((path) => ['--exclude', path]))
]
// Why: vitest 5 drops CLI --exclude for inline projects, so the selectors' substring matches
// are resolved to files here and filtered before vitest sees them.
// Electron probes run in desktop jobs; headless compatibility containers have no display.
const selectors = nodeServerTestPaths({ artifact, crossRuntime })
const skipped = new Set(crossRuntime ? [] : CROSS_RUNTIME_TEST_PATHS)
return globSync(UNIT_INCLUDE, { cwd: root })
.map((path) => path.replaceAll('\\', '/'))
.filter((path) => selectors.some((selector) => path.includes(selector)))
.filter((path) => !path.endsWith('.electron.test.ts') && !skipped.has(path))
.sort()
}