test: point the last two credential stores at the YAML document
The e2e store and the web-search store still named a `.env` path; the e2e one also wrote dotenv syntax, which the YAML document rejects. That path now names the ordinary environment layer, so a test pointing the credential store at it asserts the distinction this PR removes.
This commit is contained in:
@@ -62,14 +62,16 @@ describe.skipIf(!process.env.DEEPSEEK_API_KEY)('llm-deepseek e2e (real API)', ()
|
|||||||
if (key === undefined) throw new Error('e2e ran without DEEPSEEK_API_KEY')
|
if (key === undefined) throw new Error('e2e ran without DEEPSEEK_API_KEY')
|
||||||
const dir = await mkdtemp(join(tmpdir(), 'dsh-e2e-credentials-'))
|
const dir = await mkdtemp(join(tmpdir(), 'dsh-e2e-credentials-'))
|
||||||
try {
|
try {
|
||||||
await writeFile(join(dir, '.env'), `DEEPSEEK_API_KEY=${key}\n`, { mode: 0o600 })
|
// JSON.stringify quotes the value: YAML is a JSON superset, so a real
|
||||||
|
// key survives whatever characters it happens to carry.
|
||||||
|
await writeFile(join(dir, '.credentials.yaml'), `DEEPSEEK_API_KEY: ${JSON.stringify(key)}\n`, { mode: 0o600 })
|
||||||
// Scrub the ambient variable so only the credential seam can supply the
|
// Scrub the ambient variable so only the credential seam can supply the
|
||||||
// key: this request proves the per-request resolution path end to end.
|
// key: this request proves the per-request resolution path end to end.
|
||||||
vi.stubEnv('DEEPSEEK_API_KEY', '')
|
vi.stubEnv('DEEPSEEK_API_KEY', '')
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
contexts.push(ctx)
|
contexts.push(ctx)
|
||||||
await ctx.plugin(LlmService)
|
await ctx.plugin(LlmService)
|
||||||
await ctx.plugin(CredentialsLocal, { path: join(dir, '.env'), watch: false })
|
await ctx.plugin(CredentialsLocal, { path: join(dir, '.credentials.yaml'), watch: false })
|
||||||
await ctx.plugin(LlmDeepSeek, {})
|
await ctx.plugin(LlmDeepSeek, {})
|
||||||
|
|
||||||
const result = await assemble(ctx, {
|
const result = await assemble(ctx, {
|
||||||
|
|||||||
@@ -455,7 +455,7 @@ describe('web-search-deepseek plugin registration', () => {
|
|||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
try {
|
try {
|
||||||
await ctx.plugin(WebService, { searchProvider: DEEPSEEK_PROVIDER_ID })
|
await ctx.plugin(WebService, { searchProvider: DEEPSEEK_PROVIDER_ID })
|
||||||
await ctx.plugin(CredentialsLocal, { path: join(dir, '.env'), watch: false })
|
await ctx.plugin(CredentialsLocal, { path: join(dir, '.credentials.yaml'), watch: false })
|
||||||
await ctx.plugin(deepseekPlugin, { baseURL: 'https://api.deepseek.test/anthropic/v1' })
|
await ctx.plugin(deepseekPlugin, { baseURL: 'https://api.deepseek.test/anthropic/v1' })
|
||||||
|
|
||||||
await expect(ctx.web.search({ query: 'missing' }))
|
await expect(ctx.web.search({ query: 'missing' }))
|
||||||
|
|||||||
Reference in New Issue
Block a user