d3ro-voice/apps/desktop/tests/red/llm-polling.usecase.test.ts
Yun Chan 708e20f747
Some checks failed
CI Pipeline / Code Quality & Typecheck (push) Waiting to run
CI Pipeline / Test Suite (macos-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (ubuntu-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (windows-latest) (push) Blocked by required conditions
CI Pipeline / Build Validation (admin) (push) Blocked by required conditions
CI Pipeline / Build Validation (desktop) (push) Blocked by required conditions
Deploy Landing Page / deploy (push) Blocked by required conditions
Deploy Landing Page / build (push) Waiting to run
Release & Packaging Pipeline / Build & Publish Admin Docker Image (push) Failing after 8s
Release & Code Signing CA Pipeline / build-and-sign-windows (push) Failing after 1m51s
Build macOS / Build & Package (macOS) (push) Failing after 4s
Build macOS / Build & Package (macOS)-1 (push) Failing after 5s
Release & Code Signing CA Pipeline / build-and-sign-macos (push) Failing after 3s
Release & Packaging Pipeline / Package macOS Desktop App (push) Failing after 4s
Release & Packaging Pipeline / Package Windows Desktop App (push) Failing after 2m28s
Release & Packaging Pipeline / Publish Official GitHub Release (push) Has been skipped
feat: complete release preparation, 10+ ad mediation, CI/CD, and docker deployment
2026-08-20 11:12:05 +09:00

37 lines
1.4 KiB
TypeScript

import { describe, it, expect, vi } from 'vitest'
import fs from 'fs'
import path from 'path'
import { getLocalLLMService, startLocalLLMAvailability } from '../../src/main/services/LocalLLMService'
import { useRedHarness } from './harness'
useRedHarness()
describe('유스케이스: 앱 시작 시 로컬 LLM 폴링', () => {
it('startLocalLLMAvailability 는 ensureRunning 과 startPolling 을 호출한다', async () => {
const llm = getLocalLLMService()
const ensure = vi.spyOn(llm, 'ensureRunning').mockResolvedValue('not-installed')
const poll = vi.spyOn(llm, 'startPolling')
await startLocalLLMAvailability()
expect(ensure).toHaveBeenCalledTimes(1)
expect(poll).toHaveBeenCalledTimes(1)
llm.stopPolling()
})
it('bootstrap llm-polling 스텝은 startLocalLLMAvailability 를 호출하고 no-op 주석이 아니다', () => {
const src = fs.readFileSync(
path.join(__dirname, '../../src/main/bootstrap.ts'),
'utf-8',
)
expect(src).toContain('startLocalLLMAvailability')
expect(src).not.toContain('LocalLLMService replaced by PremiumLLMService')
})
it('폴링을 건너뛰면 isAvailable 이 계속 false 인 채 남는 경로를 허용하지 않는다', async () => {
const llm = getLocalLLMService()
expect(llm.isAvailable()).toBe(false)
const poll = vi.spyOn(llm, 'startPolling')
await startLocalLLMAvailability()
expect(poll).toHaveBeenCalled()
llm.stopPolling()
})
})