mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-08-29 04:26:38 +00:00
test(ci): deduplicate coverage command setup
This commit is contained in:
@@ -28,6 +28,14 @@ async function temporaryRoot(): Promise<string> {
|
||||
return await mkdtemp(join(tmpdir(), 'dsh-coverage-partitions-'))
|
||||
}
|
||||
|
||||
function successfulCommandRecorder(commands: CoverageCommand[]) {
|
||||
return vi.fn(async (command: CoverageCommand) => {
|
||||
commands.push(command)
|
||||
await writeBlob(command)
|
||||
return passed
|
||||
})
|
||||
}
|
||||
|
||||
describe('coverage partition count', () => {
|
||||
it.each([
|
||||
[undefined, undefined],
|
||||
@@ -77,11 +85,7 @@ describe('coverage partition coordinator', () => {
|
||||
it('runs every single-worker partition before one merged threshold check', async () => {
|
||||
const root = await temporaryRoot()
|
||||
const commands: CoverageCommand[] = []
|
||||
const runCommand = vi.fn(async (command: CoverageCommand) => {
|
||||
commands.push(command)
|
||||
await writeBlob(command)
|
||||
return passed
|
||||
})
|
||||
const runCommand = successfulCommandRecorder(commands)
|
||||
const coordinator = new CoveragePartitionCoordinator({
|
||||
root,
|
||||
partitions: 3,
|
||||
@@ -128,11 +132,7 @@ describe('coverage partition coordinator', () => {
|
||||
it('runs a native pnpm entrypoint directly', async () => {
|
||||
const root = await temporaryRoot()
|
||||
const commands: CoverageCommand[] = []
|
||||
const runCommand = vi.fn(async (command: CoverageCommand) => {
|
||||
commands.push(command)
|
||||
await writeBlob(command)
|
||||
return passed
|
||||
})
|
||||
const runCommand = successfulCommandRecorder(commands)
|
||||
const coordinator = new CoveragePartitionCoordinator({
|
||||
root,
|
||||
partitions: 2,
|
||||
|
||||
Reference in New Issue
Block a user