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:
@@ -162,8 +162,12 @@ describe('group chat history windows', () => {
|
||||
expect(storage.getMessagesForContext('room-1')).toHaveLength(160)
|
||||
expect(latest?.totalTokens).toBe(expectedTotalTokens)
|
||||
expect(storage.getRoom('room-1')?.totalTokens).toBe(expectedTotalTokens)
|
||||
})
|
||||
}, 60_000)
|
||||
|
||||
// 这个用例故意写 501 条消息来触发 prune(保留 500 条)。而
|
||||
// saveMessageAndRefreshRoom 每写一条都要重读整份转录并重新计一遍 token,
|
||||
// 单测本身就是 O(n²):单独跑约 1.3s,全量并行时 CPU 被抢,很容易撞上
|
||||
// Vitest 默认的 5s 上限。这是重测试,不是卡死 —— 显式放宽超时。
|
||||
it('preserves snapshot summary tokens when the snapshot anchor was pruned from retained history', () => {
|
||||
const storage = groupServer.getStorage()
|
||||
storage.saveRoom('room-1', 'Room 1')
|
||||
@@ -189,7 +193,7 @@ describe('group chat history windows', () => {
|
||||
expect(storage.getContextSnapshot('room-1')?.lastMessageId).toBe('msg-1')
|
||||
expect(latest?.totalTokens).toBe(expectedTotalTokens)
|
||||
expect(storage.getRoom('room-1')?.totalTokens).toBe(expectedTotalTokens)
|
||||
})
|
||||
}, 60_000)
|
||||
|
||||
it('uses the full context transcript for the final AgentClient room estimate', async () => {
|
||||
const messages = Array.from({ length: 160 }, (_value, index) => ({
|
||||
|
||||
Reference in New Issue
Block a user