chore(vitest): exclude packages/e2e/** from root unit test suite

This commit is contained in:
yiling
2026-07-15 11:40:57 +08:00
parent 83c427e646
commit d524a81ecd
6 changed files with 41 additions and 35 deletions
@@ -26,16 +26,12 @@ describe('WorkflowService Temporal Workers Concurrency Control', () => {
originalExecutor = process.env.WORKFLOW_EXECUTOR
originalTranscode = process.env.CONCURRENCY_TRANSCODE
originalAgent = process.env.CONCURRENCY_AGENT
process.env.WORKFLOW_EXECUTOR = 'temporal'
workflowService.setExecutorType('temporal')
vi.clearAllMocks()
})
afterEach(() => {
if (originalExecutor === undefined) {
delete process.env.WORKFLOW_EXECUTOR
} else {
process.env.WORKFLOW_EXECUTOR = originalExecutor
}
workflowService.setExecutorType(originalExecutor === 'temporal' ? 'temporal' : 'local')
if (originalTranscode === undefined) {
delete process.env.CONCURRENCY_TRANSCODE
+9 -1
View File
@@ -20,6 +20,14 @@ export class WorkflowService {
}
}
setExecutorType(type: 'local' | 'temporal') {
if (type === 'temporal') {
this.executor = new TemporalExecutor(process.env.TEMPORAL_ADDRESS)
} else {
this.executor = new LocalExecutor()
}
}
async submit(task: WorkflowTask): Promise<string> {
return this.executor.submit(task)
}
@@ -77,7 +85,7 @@ export class WorkflowService {
queue: string,
options: { workflowBundle?: unknown; workflowsPath?: string } = {},
): Promise<void> {
const type = process.env.WORKFLOW_EXECUTOR || 'local'
const type = this.executor instanceof TemporalExecutor ? 'temporal' : 'local'
if (type === 'temporal') {
const { Worker, NativeConnection } = await import('@temporalio/worker')