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:
@@ -102,6 +102,10 @@ vi.mock('../../packages/server/src/middleware/user-auth', () => ({
|
||||
issueModelRunJwt: issueModelRunJwtMock,
|
||||
}))
|
||||
|
||||
// 生产侧用 join(getProfileDir(profile), 'workspace') 拼默认工作区,Windows 上是
|
||||
// 反斜杠分隔。断言必须跟着走 join,否则只有 Linux 是绿的。
|
||||
const DEFAULT_PROFILE_WORKSPACE = join('/tmp/hermes-bridge-final-context/default', 'workspace')
|
||||
|
||||
function makeSocket() {
|
||||
return {
|
||||
connected: true,
|
||||
@@ -292,7 +296,7 @@ describe('bridge run final context usage', () => {
|
||||
{
|
||||
model: 'gpt-test',
|
||||
provider: 'openai',
|
||||
workspace: '/tmp/hermes-bridge-final-context/default/workspace',
|
||||
workspace: DEFAULT_PROFILE_WORKSPACE,
|
||||
},
|
||||
)
|
||||
expect(bridge.contextEstimate.mock.calls[0][2]).toContain('system prompt')
|
||||
@@ -660,7 +664,7 @@ describe('bridge run final context usage', () => {
|
||||
expect(createSessionMock).toHaveBeenCalledWith(expect.objectContaining({
|
||||
id: 'session-1',
|
||||
source: 'global_agent',
|
||||
workspace: '/tmp/hermes-bridge-final-context/default/workspace',
|
||||
workspace: DEFAULT_PROFILE_WORKSPACE,
|
||||
}))
|
||||
expect(state.source).toBe('global_agent')
|
||||
})
|
||||
@@ -1104,7 +1108,7 @@ describe('bridge run final context usage', () => {
|
||||
'default',
|
||||
expect.objectContaining({
|
||||
storage_message: '/plan build the feature',
|
||||
workspace: '/tmp/hermes-bridge-final-context/default/workspace',
|
||||
workspace: DEFAULT_PROFILE_WORKSPACE,
|
||||
}),
|
||||
)
|
||||
})
|
||||
@@ -1229,7 +1233,7 @@ describe('bridge run final context usage', () => {
|
||||
'default',
|
||||
expect.objectContaining({
|
||||
storage_message: '[IMPORTANT: expanded skill prompt]',
|
||||
workspace: '/tmp/hermes-bridge-final-context/default/workspace',
|
||||
workspace: DEFAULT_PROFILE_WORKSPACE,
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user