fix(ci): unblock headless test runs and manage Forgejo secrets from .env
- desktop: mock @nut-tree-fork/nut-js in the shared Vitest setup; template
tests reached the real TextInsertService and libnut killed the worker on the
display-less Linux runner ("Could not open main display").
- mobile: the knowledge realtime test now unsubscribes, so the deletion
reconcile interval no longer keeps Jest alive forever.
- set-forgejo-secrets.mjs syncs every Forgejo secret from the root .env and
refuses local URLs; SUPABASE_URL had been registered as 127.0.0.1:55321, so
payple-renew never succeeded.
This commit is contained in:
parent
3cac14f668
commit
a7c0d6fb21
5 changed files with 98 additions and 59 deletions
|
|
@ -102,6 +102,23 @@ vi.mock('uiohook-napi', () => ({
|
|||
}),
|
||||
}))
|
||||
|
||||
// nut-js 도 같은 이유로 막는다. 네이티브 libnut 은 X 디스플레이가 없으면 "Could not open
|
||||
// main display" 를 찍고 워커 프로세스를 죽인다(Linux 러너에서 템플릿 결과 삽입 경로가 실측
|
||||
// "Worker exited unexpectedly"). nut-js 동작이 필요한 테스트는 파일에서 다시 vi.mock 한다.
|
||||
vi.mock('@nut-tree-fork/nut-js', () => ({
|
||||
keyboard: {
|
||||
config: { autoDelayMs: 0 },
|
||||
pressKey: vi.fn(async () => undefined),
|
||||
releaseKey: vi.fn(async () => undefined),
|
||||
type: vi.fn(async () => undefined),
|
||||
},
|
||||
providerRegistry: {
|
||||
hasKeyboard: vi.fn(() => false),
|
||||
getKeyboard: vi.fn(),
|
||||
},
|
||||
Key: new Proxy<Record<string, string>>({}, { get: (_target, property) => String(property) }),
|
||||
}))
|
||||
|
||||
// WindowManager 모킹 — VoiceModeService가 import하므로 필요
|
||||
vi.mock('../src/main/windows/WindowManager', () => ({
|
||||
showRecordingTip: vi.fn(),
|
||||
|
|
|
|||
|
|
@ -237,9 +237,11 @@ describe('knowledge edge contracts', () => {
|
|||
|
||||
// redteam r3-20: 필터가 걸린 postgres_changes 는 DELETE 를 보내지 않고, 필터 없는 DELETE 구독은 남의 행 id 를 흘린다.
|
||||
// 삭제는 knowledge-realtime 의 다른 경로로 받는다 — knowledge-realtime-redteam-r3-20.test.ts 와 같은 계약.
|
||||
it('subscribes to document inserts and updates through RLS realtime, never to DELETE', () => {
|
||||
subscribeToKnowledgeDocuments(jest.fn(), jest.fn())
|
||||
it('subscribes to document inserts and updates through RLS realtime, never to DELETE', async () => {
|
||||
const subscription = subscribeToKnowledgeDocuments(jest.fn(), jest.fn())
|
||||
const events = mockRealtimeOn.mock.calls.map((call) => (call[1] as { event: string }).event)
|
||||
expect(events).toEqual(['INSERT', 'UPDATE'])
|
||||
// 구독이 삭제 대조용 setInterval 을 켠다. 끄지 않으면 Jest 가 끝나지 않아 CI 잡이 멈춘다.
|
||||
await subscription.unsubscribe()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue