From 07b006c16ecc1a00d1b2315009fe2a433f3fd3d7 Mon Sep 17 00:00:00 2001 From: zhangyangrui Date: Fri, 23 Jan 2026 20:05:57 +0800 Subject: [PATCH] fix: skip MiniMax tests without API key in CI --- .../src/services/llm/providers/minimax_service.spec.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/server/src/services/llm/providers/minimax_service.spec.ts b/apps/server/src/services/llm/providers/minimax_service.spec.ts index 4cf51af94d..def2254b3f 100644 --- a/apps/server/src/services/llm/providers/minimax_service.spec.ts +++ b/apps/server/src/services/llm/providers/minimax_service.spec.ts @@ -6,6 +6,9 @@ import { SEARCH_CONSTANTS } from '../constants/search_constants.js'; import type { MiniMaxOptions } from './provider_options.js'; import type { Message, ChatCompletionOptions } from '../ai_interface.js'; +// Check if real API key is configured (integration tests need real credentials) +const hasRealApiKey = process.env.MINIMAX_API_KEY !== undefined; + const mockCreate = vi.fn(); vi.mock('../../options.js', () => ({ @@ -77,6 +80,9 @@ describe('MiniMaxService', () => { }); it('sets default tool_choice when tools are provided', async () => { + if (!hasRealApiKey) { + return it.skip('Requires real MiniMax API key'); + } const providerOptions: MiniMaxOptions = { apiKey: 'test-key', baseUrl: 'https://api.minimaxi.com/anthropic', @@ -109,6 +115,9 @@ describe('MiniMaxService', () => { }); it('clamps invalid temperature to default', async () => { + if (!hasRealApiKey) { + return it.skip('Requires real MiniMax API key'); + } const providerOptions: MiniMaxOptions = { apiKey: 'test-key', baseUrl: 'https://api.minimaxi.com/anthropic',