扩展外部生成Worker队列
新增外部生成队列概览和单任务状态契约 将跳一跳、拼消消、敲木鱼图片生成动作接入worker队列 前端生成等待页展示当前任务和队列数量 更新外部生成worker运维文档和团队决策记录
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { describe, expect, test } from 'vitest';
|
||||
|
||||
import {
|
||||
resolveMiniGameGenerationViewBusy,
|
||||
resolveMiniGameGenerationProgressTickState,
|
||||
} from './PlatformEntryFlowShellImpl';
|
||||
import { createMiniGameDraftGenerationState } from '../../services/miniGameDraftGenerationProgress';
|
||||
import {
|
||||
resolveMiniGameGenerationProgressTickState,
|
||||
resolveMiniGameGenerationViewBusy,
|
||||
} from './PlatformEntryFlowShellImpl';
|
||||
import { buildExternalGenerationQueueStatus } from './platformExternalGenerationQueueStatusModel';
|
||||
import { resolveFinishedMiniGameDraftGenerationState } from './platformMiniGameDraftGenerationStateModel';
|
||||
|
||||
describe('resolveMiniGameGenerationProgressTickState', () => {
|
||||
@@ -57,3 +58,34 @@ describe('resolveMiniGameGenerationViewBusy', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildExternalGenerationQueueStatus', () => {
|
||||
test('合并队列概览和当前任务状态', () => {
|
||||
expect(
|
||||
buildExternalGenerationQueueStatus(
|
||||
{
|
||||
pendingCount: 7,
|
||||
runningCount: 3,
|
||||
updatedAtMicros: 1_781_222_400_000_000,
|
||||
},
|
||||
{
|
||||
operationId: 'extgen-1',
|
||||
status: 'running',
|
||||
phaseLabel: '正在生成。',
|
||||
phaseDetail: '正在生成。',
|
||||
progress: 35,
|
||||
updatedAtMicros: 1_781_222_400_000_000,
|
||||
},
|
||||
),
|
||||
).toEqual({
|
||||
currentStatus: 'running',
|
||||
currentProgress: 35,
|
||||
pendingCount: 7,
|
||||
runningCount: 3,
|
||||
});
|
||||
});
|
||||
|
||||
test('没有队列或任务信息时不显示状态条', () => {
|
||||
expect(buildExternalGenerationQueueStatus(null, null)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user