Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions integration-tests/cli/qwen-config-dir.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ describe('QWEN_HOME environment variable', () => {
// Always clean up env vars regardless of test outcome
delete process.env['QWEN_HOME'];
delete process.env['QWEN_RUNTIME_DIR'];
delete process.env['QWEN_DEBUG_LOG_FILE'];
await rig.cleanup();
});

Expand Down Expand Up @@ -324,6 +325,7 @@ describe('QWEN_HOME environment variable', () => {

process.env['QWEN_HOME'] = customConfigDir;
process.env['QWEN_RUNTIME_DIR'] = runtimeDir;
process.env['QWEN_DEBUG_LOG_FILE'] = '1';

try {
await rig.run('say hello');
Expand Down
8 changes: 8 additions & 0 deletions integration-tests/cli/simple-mcp-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ rpc.send({

describe('simple-mcp-server', () => {
const rig = new TestRig();
let previousLegacyMcpBlocking: string | undefined;
let previousMcpApprovalsPath: string | undefined;

beforeAll(async () => {
Expand All @@ -177,6 +178,7 @@ describe('simple-mcp-server', () => {
// request fires without the MCP `add` tool wired into the model's tool
// surface, so the model answers `15` directly and `foundToolCall` stays
// false. Remove once QwenLM/qwen-code#4163 is fixed.
previousLegacyMcpBlocking = process.env['QWEN_CODE_LEGACY_MCP_BLOCKING'];
process.env['QWEN_CODE_LEGACY_MCP_BLOCKING'] = '1';

// Setup test directory with MCP server configuration
Expand Down Expand Up @@ -238,6 +240,12 @@ describe('simple-mcp-server', () => {
});

afterAll(() => {
if (previousLegacyMcpBlocking === undefined) {
delete process.env['QWEN_CODE_LEGACY_MCP_BLOCKING'];
} else {
process.env['QWEN_CODE_LEGACY_MCP_BLOCKING'] = previousLegacyMcpBlocking;
}

if (previousMcpApprovalsPath === undefined) {
delete process.env['QWEN_CODE_MCP_APPROVALS_PATH'];
} else {
Expand Down
16 changes: 16 additions & 0 deletions packages/cli/src/utils/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,22 @@ export async function start_sandbox(
`QWEN_CODE_TEST_VAR=${process.env['QWEN_CODE_TEST_VAR']}`,
);
}
for (const envVar of [
'QWEN_DEBUG_LOG_FILE',
'QWEN_CODE_LEGACY_MCP_BLOCKING',
] as const) {
if (process.env[envVar]) {
args.push('--env', `${envVar}=${process.env[envVar]}`);
}
}
if (process.env['QWEN_CODE_MCP_APPROVALS_PATH']) {
args.push(
'--env',
`QWEN_CODE_MCP_APPROVALS_PATH=${getContainerPath(
process.env['QWEN_CODE_MCP_APPROVALS_PATH'],
)}`,
);
}

// copy GEMINI_API_KEY(s)
if (process.env['GEMINI_API_KEY']) {
Expand Down
Loading