mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-16 19:36:54 +00:00
Hermes points TMPDIR at ~/.hermes/cache/scratch, so every Desktop test run's leftovers pile up there until the 24h idle pruner catches them: one day on a dev host left 688 playwright-tracing-*, 152 playwright-artifacts-*, 75 hermes-e2e-mock-* sandboxes and ~600 small vitest mkdtemp dirs. - Playwright (main + core configs): e2e/run-tmp.ts gives the run one temp root that workers, Electron and the backend inherit via TMPDIR, and removes it when the runner exits. Covers the stack-trace dirs the Electron tracing patch orphans (2 per launch, even on green runs), sandboxes a failed/timed-out setup never cleans, and Playwright's own artifact dirs. A SIGKILLed run now leaves one pw-* dir for the pruner. The update suite keeps os.tmpdir(): its seeded install is reused across runs and bakes its path into AF_UNIX sockets. - vitest (apps/desktop): globalSetup does the same for the run; one `--project electron` run left 54 dirs from tests that never remove what they mkdtemp.
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import type { TestProjectConfiguration } from 'vitest/config'
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
const reactUi: TestProjectConfiguration = {
|
|
extends: './vite.config.ts',
|
|
test: {
|
|
name: 'ui',
|
|
environment: 'jsdom',
|
|
// Keep padding regressions observable instead of mocking the stylesheet away.
|
|
css: { include: [/status-stack\.css$/] },
|
|
setupFiles: ['./vitest.setup.ts'],
|
|
include: ['src/**/*.test.{ts,tsx}'],
|
|
globals: true,
|
|
// The first test in each file pays jsdom env init + full module transform,
|
|
// which can exceed vitest's 5000ms default under CI/load. 15s gives the
|
|
// cold start headroom without masking genuinely hung tests. Hooks pay the
|
|
// same cold cost when a beforeEach does `vi.resetModules()` + `await
|
|
// import(...)` (65 files); one timed out at 10s on CI (#120318).
|
|
testTimeout: 15_000,
|
|
hookTimeout: 30_000
|
|
}
|
|
}
|
|
|
|
const electronNative: TestProjectConfiguration = {
|
|
test: {
|
|
name: 'electron',
|
|
environment: 'node',
|
|
// `e2e/**/*.unit.test.ts` is the e2e HELPERS, not the specs: plain node
|
|
// modules that should be provable without booting Electron. Playwright
|
|
// ignores the same pattern so they run in exactly one runner.
|
|
include: ['electron/**/*.test.ts', 'scripts/**.test.{ts,mjs}', 'e2e/**/*.unit.test.ts']
|
|
}
|
|
}
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globalSetup: ['./vitest.run-tmp.ts'],
|
|
projects: [reactUi, electronNative]
|
|
}
|
|
})
|