mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Merge pull request #1150 from QwenLM/mingholy/ci/skip-case
test: skip qwen-oauth test in containerized environments
This commit is contained in:
@@ -438,10 +438,15 @@ describe('Configuration Options (E2E)', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should accept authType: qwen-oauth', async () => {
|
// Skip in containerized sandbox environments - qwen-oauth requires user interaction
|
||||||
// Note: qwen-oauth requires credentials in ~/.qwen
|
// which is not possible in Docker/Podman CI environments
|
||||||
// This test may fail if credentials are not configured
|
it.skipIf(
|
||||||
// The test verifies the option is accepted and passed correctly
|
process.env['SANDBOX'] === 'sandbox:docker' ||
|
||||||
|
process.env['SANDBOX'] === 'sandbox:podman',
|
||||||
|
)('should accept authType: qwen-oauth', async () => {
|
||||||
|
// Note: qwen-oauth requires credentials in ~/.qwen and user interaction
|
||||||
|
// Without credentials, the auth process will timeout waiting for user
|
||||||
|
// This test verifies the option is accepted and passed correctly to CLI
|
||||||
|
|
||||||
const stderrMessages: string[] = [];
|
const stderrMessages: string[] = [];
|
||||||
|
|
||||||
@@ -452,6 +457,7 @@ describe('Configuration Options (E2E)', () => {
|
|||||||
cwd: testDir,
|
cwd: testDir,
|
||||||
authType: 'qwen-oauth',
|
authType: 'qwen-oauth',
|
||||||
debug: true,
|
debug: true,
|
||||||
|
logLevel: 'debug',
|
||||||
stderr: (msg: string) => {
|
stderr: (msg: string) => {
|
||||||
stderrMessages.push(msg);
|
stderrMessages.push(msg);
|
||||||
},
|
},
|
||||||
@@ -461,16 +467,31 @@ describe('Configuration Options (E2E)', () => {
|
|||||||
const messages: SDKMessage[] = [];
|
const messages: SDKMessage[] = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for await (const message of q) {
|
// Use a timeout to avoid hanging when credentials are not configured
|
||||||
messages.push(message);
|
const timeoutPromise = new Promise<'timeout'>((resolve) =>
|
||||||
}
|
setTimeout(() => resolve('timeout'), 20000),
|
||||||
|
);
|
||||||
|
|
||||||
// The query should at least start (may fail due to missing credentials)
|
const collectMessages = async () => {
|
||||||
expect(messages.length).toBeGreaterThan(0);
|
for await (const message of q) {
|
||||||
} catch (error) {
|
messages.push(message);
|
||||||
// qwen-oauth may fail if credentials are not configured
|
}
|
||||||
// This is acceptable - we're testing that the option is passed correctly
|
return 'completed';
|
||||||
expect(error).toBeDefined();
|
};
|
||||||
|
|
||||||
|
const result = await Promise.race([collectMessages(), timeoutPromise]);
|
||||||
|
|
||||||
|
if (result === 'timeout') {
|
||||||
|
// Timeout is expected when OAuth credentials are not configured
|
||||||
|
// Verify that CLI was spawned with correct --auth-type argument
|
||||||
|
const hasAuthTypeArg = stderrMessages.some((msg) =>
|
||||||
|
msg.includes('--auth-type'),
|
||||||
|
);
|
||||||
|
expect(hasAuthTypeArg).toBe(true);
|
||||||
|
} else {
|
||||||
|
// If credentials exist and auth completed, verify we got messages
|
||||||
|
expect(messages.length).toBeGreaterThan(0);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
await q.close();
|
await q.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -449,8 +449,8 @@ export async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const nonInteractiveConfig = await validateNonInteractiveAuth(
|
const nonInteractiveConfig = await validateNonInteractiveAuth(
|
||||||
settings.merged.security?.auth?.selectedType ||
|
(argv.authType as AuthType) ||
|
||||||
(argv.authType as AuthType),
|
settings.merged.security?.auth?.selectedType,
|
||||||
settings.merged.security?.auth?.useExternal,
|
settings.merged.security?.auth?.useExternal,
|
||||||
config,
|
config,
|
||||||
settings,
|
settings,
|
||||||
|
|||||||
Reference in New Issue
Block a user