make the test suite and openapi generator platform-independent

Windows checkouts turned LF into CRLF (core.autocrlf=true), and several
tests plus the openapi generator hardcoded LF or POSIX path separators.
The result was a suite that was green on Linux CI but red on Windows, and
an openapi.json whose /api/hermes/* routes silently disappeared when
generated on Windows.

Pin the repository to LF via .gitattributes, strip shebangs before
Vite's SSR transform, and key route files by their posix path. Add a
manually triggered macOS verification workflow so the same checks run
on a self-hosted macOS runner.
This commit is contained in:
2026-10-20 11:17:34 +08:00
committed by trae-solo-agent
parent 8052bf5781
commit a1fff482bf
20 changed files with 251 additions and 48 deletions
+9 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it, vi } from 'vitest'
import { beforeAll, describe, expect, it, vi } from 'vitest'
const chatRunMock = vi.hoisted(() => ({
runAndWait: vi.fn(),
@@ -22,6 +22,14 @@ vi.mock('../../packages/server/src/db/hermes/session-store', async (importOrigin
})
describe('workflow manager', () => {
beforeAll(async () => {
// 建表只在 server bootstrap(packages/server/src/index.ts)里执行,单测不走
// bootstrap。workflows 表能不能用,取决于别的测试文件有没有先建过它 ——
// 这是顺序依赖的偶发失败。这里显式建表,让本文件自给自足。
const { initAllHermesTables } = await import('../../packages/server/src/db/hermes/schemas')
initAllHermesTables()
})
it('returns a server-wide singleton instance', async () => {
const { WorkflowManager, getWorkflowManager } = await import('../../packages/server/src/services/workflow-manager')