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:
@@ -205,7 +205,11 @@ describe('gateway-runner supervision', () => {
|
||||
startGatewayRunManaged('/usr/bin/hermes', { profileDir: '/tmp/delete-me' })
|
||||
expect(fakeChildren).toHaveLength(1)
|
||||
|
||||
const retired = retireManagedGatewayForProfile('/tmp/delete-me', { timeoutMs: 5000 })
|
||||
// 固定 platform:停止网关的手段随平台不同(POSIX 走 child.kill('SIGTERM'),
|
||||
// Windows 走 taskkill 杀进程树),不固定的话这个用例会随运行平台变形。
|
||||
// Windows 分支由同文件末尾的 "kills the managed gateway process tree on
|
||||
// Windows shutdown" 单独覆盖。
|
||||
const retired = retireManagedGatewayForProfile('/tmp/delete-me', { timeoutMs: 5000, platform: 'linux' })
|
||||
expect(fakeChildren[0].killSignals).toEqual(['SIGTERM'])
|
||||
|
||||
fakeChildren[0].emit('exit', 0, 'SIGTERM')
|
||||
@@ -226,7 +230,7 @@ describe('gateway-runner supervision', () => {
|
||||
startGatewayRunManaged('/usr/bin/hermes', { profileDir: '/tmp/shutdown-b' })
|
||||
expect(fakeChildren).toHaveLength(2)
|
||||
|
||||
const shutdown = shutdownManagedGateways({ timeoutMs: 5000 })
|
||||
const shutdown = shutdownManagedGateways({ timeoutMs: 5000, platform: 'linux' })
|
||||
|
||||
expect(fakeChildren[0].killSignals).toEqual(['SIGTERM'])
|
||||
expect(fakeChildren[1].killSignals).toEqual(['SIGTERM'])
|
||||
@@ -266,7 +270,7 @@ describe('gateway-runner supervision', () => {
|
||||
|
||||
startGatewayRunManaged('/usr/bin/hermes', { profileDir: '/tmp/shutdown-d' })
|
||||
|
||||
const shutdown = shutdownManagedGateways({ timeoutMs: 1000 })
|
||||
const shutdown = shutdownManagedGateways({ timeoutMs: 1000, platform: 'linux' })
|
||||
expect(fakeChildren[0].killSignals).toEqual(['SIGTERM'])
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1000)
|
||||
|
||||
Reference in New Issue
Block a user