Files
deepseek-harness/scripts/python-runtime-deploy.spec.ts
T
fz 125fabd8d0 fix(python): deploy the runtime from the workspace lockfile
(cherry picked from commit c2e5f4828ecf698ba17c6b2eab67ff7b3a914d49)
2026-11-02 16:07:28 +08:00

36 lines
1.2 KiB
TypeScript

import { resolve } from 'node:path'
import { pathToFileURL } from 'node:url'
import { expect, it } from 'vitest'
import { hooks } from './python-runtime-deploy.pnpmfile.mjs'
it('preserves exact local build approvals, denials, and unrelated configuration', () => {
const config = {
strictDepBuilds: true,
allowBuilds: {
'allowed@file:packages/allowed': true,
'denied@file:packages/denied': false,
'pending@file:packages/pending': 'set this to true or false',
'absolute@file:///already/reviewed': true,
'registry-package': false,
},
}
const identity = (name: string) => `${name}@${pathToFileURL(resolve(import.meta.dirname, '..', 'packages', name)).href}`
expect(hooks.updateConfig(config)).toEqual({
strictDepBuilds: true,
allowBuilds: {
[identity('allowed')]: true,
[identity('denied')]: false,
[identity('pending')]: 'set this to true or false',
'absolute@file:///already/reviewed': true,
'registry-package': false,
},
})
expect(config.allowBuilds['allowed@file:packages/allowed']).toBe(true)
})
it('leaves configuration without local build rules unchanged', () => {
const config = { strictDepBuilds: true }
expect(hooks.updateConfig(config)).toBe(config)
})