mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix: e2e test (#905)
This commit is contained in:
@@ -36,10 +36,10 @@ describe('JSON output', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return a JSON error for enforced auth mismatch before running', async () => {
|
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', {
|
await rig.setup('json-output-auth-mismatch', {
|
||||||
settings: {
|
settings: {
|
||||||
security: { auth: { enforcedType: 'gemini-api-key' } },
|
security: { auth: { enforcedType: 'openai' } },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ describe('JSON output', () => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
thrown = e as Error;
|
thrown = e as Error;
|
||||||
} finally {
|
} finally {
|
||||||
delete process.env['GOOGLE_GENAI_USE_GCA'];
|
delete process.env['QWEN_OAUTH'];
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(thrown).toBeDefined();
|
expect(thrown).toBeDefined();
|
||||||
@@ -79,11 +79,7 @@ describe('JSON output', () => {
|
|||||||
expect(payload.error).toBeDefined();
|
expect(payload.error).toBeDefined();
|
||||||
expect(payload.error.type).toBe('Error');
|
expect(payload.error.type).toBe('Error');
|
||||||
expect(payload.error.code).toBe(1);
|
expect(payload.error.code).toBe(1);
|
||||||
expect(payload.error.message).toContain(
|
expect(payload.error.message).toContain('configured auth type is openai');
|
||||||
'configured auth type is gemini-api-key',
|
expect(payload.error.message).toContain('current auth type is qwen-oauth');
|
||||||
);
|
|
||||||
expect(payload.error.message).toContain(
|
|
||||||
'current auth type is oauth-personal',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import { mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|||||||
import { join, dirname } from 'node:path';
|
import { join, dirname } from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { env } from 'node:process';
|
import { env } from 'node:process';
|
||||||
import { DEFAULT_QWEN_MODEL } from '../packages/core/src/config/models.js';
|
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import { EOL } from 'node:os';
|
import { EOL } from 'node:os';
|
||||||
import * as pty from '@lydell/node-pty';
|
import * as pty from '@lydell/node-pty';
|
||||||
@@ -182,7 +181,6 @@ export class TestRig {
|
|||||||
otlpEndpoint: '',
|
otlpEndpoint: '',
|
||||||
outfile: telemetryPath,
|
outfile: telemetryPath,
|
||||||
},
|
},
|
||||||
model: DEFAULT_QWEN_MODEL,
|
|
||||||
sandbox: env.GEMINI_SANDBOX !== 'false' ? env.GEMINI_SANDBOX : false,
|
sandbox: env.GEMINI_SANDBOX !== 'false' ? env.GEMINI_SANDBOX : false,
|
||||||
...options.settings, // Allow tests to override/add settings
|
...options.settings, // Allow tests to override/add settings
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user