mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-10-26 16:55:08 +00:00
test(web): use returned ids for background job scenarios
This commit is contained in:
1 parent
6ce8654ff6
commit
932a19b0f9
3 files changed
+9
-5
No files matched your search
@@ -95,7 +95,7 @@ describe.skipIf(MODE === 'record')('web e2e: background job list', () => {
|
||||
agent,
|
||||
})
|
||||
const reported = started.content.map(block => block.type === 'text' ? block.text : '').join('')
|
||||
const matched = /\bbash-\d+\b/.exec(reported)
|
||||
const matched = /\bbash-[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\b/.exec(reported)
|
||||
if (matched === null) throw new Error(`background bash reported no job id: ${reported}`)
|
||||
const jobId = JobId(matched[0])
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ describe.skipIf(MODE === 'record')('web e2e: live job stream', () => {
|
||||
agent,
|
||||
})
|
||||
const reported = started.content.map(block => block.type === 'text' ? block.text : '').join('')
|
||||
const matched = /\bbash-\d+\b/.exec(reported)
|
||||
const matched = /\bbash-[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\b/.exec(reported)
|
||||
if (matched === null) throw new Error(`background bash reported no job id: ${reported}`)
|
||||
const jobId = JobId(matched[0])
|
||||
|
||||
|
||||
@@ -689,9 +689,13 @@ it('lets a preset producer reach the background-job registry', async () => {
|
||||
},
|
||||
agent: handle.agent,
|
||||
})
|
||||
const reported = started.content.map(block => block.type === 'text' ? block.text : '').join('')
|
||||
const matched = /^started background job (bash-[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})$/.exec(reported)
|
||||
if (matched === null) throw new Error(`background bash reported no job id: ${reported}`)
|
||||
const jobId = matched[1]
|
||||
expect({ isError: started.isError, content: started.content }).toEqual({
|
||||
isError: false,
|
||||
content: [{ type: 'text', text: 'started background job bash-1' }],
|
||||
content: [{ type: 'text', text: `started background job ${jobId}` }],
|
||||
})
|
||||
|
||||
// The controller reads what the producer started: same registry, one
|
||||
@@ -705,7 +709,7 @@ it('lets a preset producer reach the background-job registry', async () => {
|
||||
})
|
||||
expect(listed.isError).toBe(false)
|
||||
expect(listed.content).toEqual([
|
||||
{ type: 'text', text: expect.stringContaining('bash-1 [bash]') as unknown as string },
|
||||
{ type: 'text', text: expect.stringContaining(`${jobId} [bash]`) as unknown as string },
|
||||
])
|
||||
|
||||
// The full round trip: the output a host-plane producer wrote is collected
|
||||
@@ -714,7 +718,7 @@ it('lets a preset producer reach the background-job registry', async () => {
|
||||
signal,
|
||||
callId: ToolCallId('shipped-task-output'),
|
||||
name: 'job_output',
|
||||
arguments: { job_id: 'bash-1', wait: true },
|
||||
arguments: { job_id: jobId, wait: true },
|
||||
agent: handle.agent,
|
||||
})
|
||||
expect(collected.isError).toBe(false)
|
||||
|
||||
Reference in new issue
Block a user