mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 17:47:40 +00:00
- test:changed exits before starting Vitest when Git reports no changed files. - Unrecorded tests beyond 100 in scope use Vitest's static import graph instead of all running, so a fresh worktree's first changed run no longer runs the whole suite (patched RecordedModulesResolver; CI does not record, unchanged). - Bun's slow config load was the SQLite import scan statting every unit test; filtered runs now classify only the tests their filters can select, and the scan walks directories instead of fs.globSync. - Silence the native config loader notice on every run. - Zod's test bundle is content-addressed and reused, so a killed run leaks nothing; leaked per-run directories older than 6h are swept. - build:packages skips compiling when package inputs, compiler, and dist are unchanged; test scripts no longer nest pnpm invocations.
27 lines
1015 B
JavaScript
27 lines
1015 B
JavaScript
import { existsSync, mkdirSync, mkdtempSync, rmSync, utimesSync } from 'node:fs'
|
|
import { tmpdir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { afterEach, expect, it } from 'vitest'
|
|
import { createVitestZodBundle } from './vitest-zod-bundle.mjs'
|
|
|
|
let root
|
|
afterEach(() => rmSync(root, { recursive: true, force: true }))
|
|
|
|
it('reuses one bundle across runs and removes directories leaked by killed runs', () => {
|
|
root = mkdtempSync(join(tmpdir(), 'orca-zod-bundle-'))
|
|
const leaked = join(root, '.tmp', 'vitest-zod-leaked')
|
|
const active = join(root, '.tmp', 'vitest-zod-active')
|
|
mkdirSync(leaked, { recursive: true })
|
|
mkdirSync(active)
|
|
const hoursAgo = new Date(Date.now() - 7 * 60 * 60 * 1000)
|
|
utimesSync(leaked, hoursAgo, hoursAgo)
|
|
|
|
const first = createVitestZodBundle(root)
|
|
const second = createVitestZodBundle(root)
|
|
|
|
expect(second.path).toBe(first.path)
|
|
expect(existsSync(first.path)).toBe(true)
|
|
expect(existsSync(leaked)).toBe(false)
|
|
expect(existsSync(active)).toBe(true)
|
|
})
|