mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-22 03:03:56 +00:00
fix: e2e test (#905)
This commit is contained in:
parent
f8be8a61c8
commit
c1164bdd7e
2 changed files with 5 additions and 11 deletions
|
|
@ -36,10 +36,10 @@ describe('JSON output', () => {
|
|||
});
|
||||
|
||||
it('should return a JSON error for enforced auth mismatch before running', async () => {
|
||||
process.env['GOOGLE_GENAI_USE_GCA'] = 'true';
|
||||
process.env['QWEN_OAUTH'] = 'true';
|
||||
await rig.setup('json-output-auth-mismatch', {
|
||||
settings: {
|
||||
security: { auth: { enforcedType: 'gemini-api-key' } },
|
||||
security: { auth: { enforcedType: 'openai' } },
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ describe('JSON output', () => {
|
|||
} catch (e) {
|
||||
thrown = e as Error;
|
||||
} finally {
|
||||
delete process.env['GOOGLE_GENAI_USE_GCA'];
|
||||
delete process.env['QWEN_OAUTH'];
|
||||
}
|
||||
|
||||
expect(thrown).toBeDefined();
|
||||
|
|
@ -79,11 +79,7 @@ describe('JSON output', () => {
|
|||
expect(payload.error).toBeDefined();
|
||||
expect(payload.error.type).toBe('Error');
|
||||
expect(payload.error.code).toBe(1);
|
||||
expect(payload.error.message).toContain(
|
||||
'configured auth type is gemini-api-key',
|
||||
);
|
||||
expect(payload.error.message).toContain(
|
||||
'current auth type is oauth-personal',
|
||||
);
|
||||
expect(payload.error.message).toContain('configured auth type is openai');
|
||||
expect(payload.error.message).toContain('current auth type is qwen-oauth');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import { mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|||
import { join, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { env } from 'node:process';
|
||||
import { DEFAULT_QWEN_MODEL } from '../packages/core/src/config/models.js';
|
||||
import fs from 'node:fs';
|
||||
import { EOL } from 'node:os';
|
||||
import * as pty from '@lydell/node-pty';
|
||||
|
|
@ -182,7 +181,6 @@ export class TestRig {
|
|||
otlpEndpoint: '',
|
||||
outfile: telemetryPath,
|
||||
},
|
||||
model: DEFAULT_QWEN_MODEL,
|
||||
sandbox: env.GEMINI_SANDBOX !== 'false' ? env.GEMINI_SANDBOX : false,
|
||||
...options.settings, // Allow tests to override/add settings
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue