fix(tests): lsp specs ride the seam scrub; acp e2e mounts the subprocess service
CI now exports DSH_GATE_CONCURRENCY into every job, and the lsp suites spread the raw parent env into the spawn spec's ordinary channel — which the seam rightly rejects for DSH_* names. The specs now build their child env the way production does (scrubbedParentEnv() + explicit extras). The acp with-key e2e never mounted dsh-subprocess-local, leaving the provider's inject unsatisfied, so no 'acp' provider ever registered.
This commit is contained in:
@@ -2,6 +2,7 @@ import { afterEach, describe, expect, it } from 'vitest'
|
|||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import { LspConnection } from '@deepseek-ai/dsh-lsp-local'
|
import { LspConnection } from '@deepseek-ai/dsh-lsp-local'
|
||||||
import type { ConnectionWriter } from '@deepseek-ai/dsh-lsp-local/src/connection.ts'
|
import type { ConnectionWriter } from '@deepseek-ai/dsh-lsp-local/src/connection.ts'
|
||||||
|
import { scrubbedParentEnv } from '@deepseek-ai/dsh-subprocess'
|
||||||
import { spawnSubprocess } from '@deepseek-ai/dsh-subprocess-local/src/spawn.ts'
|
import { spawnSubprocess } from '@deepseek-ai/dsh-subprocess-local/src/spawn.ts'
|
||||||
|
|
||||||
const fixtureServer = fileURLToPath(new URL('./fixture-server.ts', import.meta.url))
|
const fixtureServer = fileURLToPath(new URL('./fixture-server.ts', import.meta.url))
|
||||||
@@ -29,7 +30,7 @@ function connect(
|
|||||||
command: process.execPath,
|
command: process.execPath,
|
||||||
args: [fixtureServer],
|
args: [fixtureServer],
|
||||||
cwd: process.cwd(),
|
cwd: process.cwd(),
|
||||||
env: { ...process.env as Record<string, string>, ...env },
|
env: { ...scrubbedParentEnv(), ...env },
|
||||||
maxMessageBytes: 16_000_000,
|
maxMessageBytes: 16_000_000,
|
||||||
maxStderrBytes: 100_000,
|
maxStderrBytes: 100_000,
|
||||||
pipeDrainGraceMs: 3_000,
|
pipeDrainGraceMs: 3_000,
|
||||||
@@ -139,7 +140,7 @@ function connectScript(script: string, maxStderrBytes = 100_000, writer?: Connec
|
|||||||
command: process.execPath,
|
command: process.execPath,
|
||||||
args: ['-e', script],
|
args: ['-e', script],
|
||||||
cwd: process.cwd(),
|
cwd: process.cwd(),
|
||||||
env: { ...process.env as Record<string, string> },
|
env: scrubbedParentEnv(),
|
||||||
maxMessageBytes: 16_000_000,
|
maxMessageBytes: 16_000_000,
|
||||||
maxStderrBytes,
|
maxStderrBytes,
|
||||||
pipeDrainGraceMs: 3_000,
|
pipeDrainGraceMs: 3_000,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import type { ConnectionWriter } from '@deepseek-ai/dsh-lsp-local/src/connection
|
|||||||
import { escalateProcessTree } from '@deepseek-ai/dsh-lsp-local/src/instance.ts'
|
import { escalateProcessTree } from '@deepseek-ai/dsh-lsp-local/src/instance.ts'
|
||||||
import type { InstanceSpec } from '@deepseek-ai/dsh-lsp-local/src/instance.ts'
|
import type { InstanceSpec } from '@deepseek-ai/dsh-lsp-local/src/instance.ts'
|
||||||
import type { LspProviderQuery, LspQueryResult } from '@deepseek-ai/dsh-lsp'
|
import type { LspProviderQuery, LspQueryResult } from '@deepseek-ai/dsh-lsp'
|
||||||
|
import { scrubbedParentEnv } from '@deepseek-ai/dsh-subprocess'
|
||||||
import { spawnSubprocess } from '@deepseek-ai/dsh-subprocess-local/src/spawn.ts'
|
import { spawnSubprocess } from '@deepseek-ai/dsh-subprocess-local/src/spawn.ts'
|
||||||
|
|
||||||
const fixtureServer = fileURLToPath(new URL('./fixture-server.ts', import.meta.url))
|
const fixtureServer = fileURLToPath(new URL('./fixture-server.ts', import.meta.url))
|
||||||
@@ -39,7 +40,7 @@ function makeInstance(
|
|||||||
command: process.execPath,
|
command: process.execPath,
|
||||||
args: [fixtureServer],
|
args: [fixtureServer],
|
||||||
cwd: ws,
|
cwd: ws,
|
||||||
env: { ...process.env as Record<string, string>, ...env },
|
env: { ...scrubbedParentEnv(), ...env },
|
||||||
configuration: { setting: 42 },
|
configuration: { setting: 42 },
|
||||||
initializationOptions: { init: true },
|
initializationOptions: { init: true },
|
||||||
maxMessageBytes: 16_000_000,
|
maxMessageBytes: 16_000_000,
|
||||||
@@ -69,7 +70,7 @@ function scriptInstance(script: string, overrides: Partial<InstanceSpec> = {}):
|
|||||||
command: process.execPath,
|
command: process.execPath,
|
||||||
args: ['-e', script],
|
args: ['-e', script],
|
||||||
cwd: ws,
|
cwd: ws,
|
||||||
env: { ...process.env as Record<string, string> },
|
env: scrubbedParentEnv(),
|
||||||
configuration: null,
|
configuration: null,
|
||||||
initializationOptions: null,
|
initializationOptions: null,
|
||||||
maxMessageBytes: 16_000_000,
|
maxMessageBytes: 16_000_000,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { afterEach, describe, expect, it } from 'vitest'
|
|||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import type { Agent } from '@deepseek-ai/dsh-agent'
|
import type { Agent } from '@deepseek-ai/dsh-agent'
|
||||||
import SubagentService from '@deepseek-ai/dsh-subagent'
|
import SubagentService from '@deepseek-ai/dsh-subagent'
|
||||||
|
import LocalSubprocessService from '@deepseek-ai/dsh-subprocess-local'
|
||||||
import { resolveExampleLaunch } from '@deepseek-ai/dsh-loader-smoke'
|
import { resolveExampleLaunch } from '@deepseek-ai/dsh-loader-smoke'
|
||||||
import * as acp from '../src/index.ts'
|
import * as acp from '../src/index.ts'
|
||||||
|
|
||||||
@@ -52,6 +53,7 @@ describe.skipIf(!process.env.DEEPSEEK_API_KEY)('ACP backend with-key e2e (drive
|
|||||||
workdir = await mkdtemp(join(tmpdir(), 'dsh-subagent-acp-e2e-'))
|
workdir = await mkdtemp(join(tmpdir(), 'dsh-subagent-acp-e2e-'))
|
||||||
ctx = new Context()
|
ctx = new Context()
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
|
await ctx.plugin(LocalSubprocessService)
|
||||||
await ctx.plugin(acp, {
|
await ctx.plugin(acp, {
|
||||||
providerName: 'acp',
|
providerName: 'acp',
|
||||||
command: childLaunch.command,
|
command: childLaunch.command,
|
||||||
@@ -81,6 +83,7 @@ describe.skipIf(!process.env.DEEPSEEK_API_KEY)('ACP backend with-key e2e (drive
|
|||||||
workdir = await mkdtemp(join(tmpdir(), 'dsh-subagent-acp-e2e-'))
|
workdir = await mkdtemp(join(tmpdir(), 'dsh-subagent-acp-e2e-'))
|
||||||
ctx = new Context()
|
ctx = new Context()
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
|
await ctx.plugin(LocalSubprocessService)
|
||||||
await ctx.plugin(acp, {
|
await ctx.plugin(acp, {
|
||||||
providerName: 'acp',
|
providerName: 'acp',
|
||||||
command: childLaunch.command,
|
command: childLaunch.command,
|
||||||
|
|||||||
Reference in New Issue
Block a user