fix(ci): stabilize static and coverage gates
This commit is contained in:
@@ -663,7 +663,10 @@ describe('dsh-workflow-workerthread', () => {
|
|||||||
`),
|
`),
|
||||||
parent,
|
parent,
|
||||||
})
|
})
|
||||||
await vi.waitFor(() => { expect(order.filter(entry => entry.startsWith('start:')).length).toBe(2) })
|
await vi.waitFor(
|
||||||
|
() => { expect(order.filter(entry => entry.startsWith('start:')).length).toBe(2) },
|
||||||
|
{ timeout: 5_000 },
|
||||||
|
)
|
||||||
const fast = provider.runs.find(run => (run.request.prompt[0] as { text?: string }).text === 'fast')!
|
const fast = provider.runs.find(run => (run.request.prompt[0] as { text?: string }).text === 'fast')!
|
||||||
fast.settle(text('fast done'))
|
fast.settle(text('fast done'))
|
||||||
handle.cancel('stop now')
|
handle.cancel('stop now')
|
||||||
@@ -802,7 +805,10 @@ describe('dsh-workflow-workerthread', () => {
|
|||||||
`),
|
`),
|
||||||
parent,
|
parent,
|
||||||
})
|
})
|
||||||
await vi.waitFor(() => { expect(order.filter(entry => entry.startsWith('start:')).length).toBe(2) })
|
await vi.waitFor(
|
||||||
|
() => { expect(order.filter(entry => entry.startsWith('start:')).length).toBe(2) },
|
||||||
|
{ timeout: 5_000 },
|
||||||
|
)
|
||||||
const fast = provider.runs.find(run => (run.request.prompt[0] as { text?: string }).text === 'fast')!
|
const fast = provider.runs.find(run => (run.request.prompt[0] as { text?: string }).text === 'fast')!
|
||||||
fast.settle(text('fast done'))
|
fast.settle(text('fast done'))
|
||||||
const result = await handle.result
|
const result = await handle.result
|
||||||
|
|||||||
@@ -286,18 +286,28 @@ function demoSmokeGate(options: { needs?: string[] } = {}): Gate {
|
|||||||
...dependencyOptions,
|
...dependencyOptions,
|
||||||
verify: async (result) => {
|
verify: async (result) => {
|
||||||
const output = result.stdout + result.stderr
|
const output = result.stdout + result.stderr
|
||||||
if (!output.includes('[tool call] echo({"text":"ci smoke"})')) {
|
const sessionsRoot = join(root, '.sessions')
|
||||||
throw new Error('demo smoke did not show the echo tool call.')
|
try {
|
||||||
|
if (!output.includes('[tool call] echo({"text":"ci smoke"})')) {
|
||||||
|
throw new Error('demo smoke did not show the echo tool call.')
|
||||||
|
}
|
||||||
|
if (!output.includes('[tool result] ECHO: CI SMOKE')) {
|
||||||
|
throw new Error('demo smoke did not show the echo tool result.')
|
||||||
|
}
|
||||||
|
const buckets = await readdir(sessionsRoot, { withFileTypes: true })
|
||||||
|
let found = false
|
||||||
|
for (const bucket of buckets) {
|
||||||
|
if (!bucket.isDirectory() || !bucket.name.startsWith('cwd-')) continue
|
||||||
|
const entries = await readdir(join(sessionsRoot, bucket.name))
|
||||||
|
if (entries.some(entry => /^main-session-.+\.jsonl$/.test(entry))) {
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) throw new Error('demo smoke did not create a main-session JSONL log in a cwd bucket.')
|
||||||
|
} finally {
|
||||||
|
await rm(sessionsRoot, { recursive: true, force: true })
|
||||||
}
|
}
|
||||||
if (!output.includes('[tool result] ECHO: CI SMOKE')) {
|
|
||||||
throw new Error('demo smoke did not show the echo tool result.')
|
|
||||||
}
|
|
||||||
const sessionDir = join(root, '.sessions', '_no-cwd')
|
|
||||||
const entries = await readdir(sessionDir)
|
|
||||||
if (!entries.some(entry => /^main-session-.+\.jsonl$/.test(entry))) {
|
|
||||||
throw new Error('demo smoke did not create a main-session JSONL log.')
|
|
||||||
}
|
|
||||||
await rm(join(root, '.sessions'), { recursive: true, force: true })
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user