Test mongo log (#4443)

* feat: mongodb-log (#4426)

* perf: mongo log

* feat: completions stop reasoner

* mongo db log

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
Archer
2025-04-03 11:43:34 +08:00
committed by archer
parent 252ad8a611
commit 915569fe79
47 changed files with 305 additions and 137 deletions

View File

@@ -1,6 +1,12 @@
import { existsSync, readFileSync } from 'fs';
import mongoose from '@fastgpt/service/common/mongo';
import { connectMongo } from '@fastgpt/service/common/mongo/init';
import {
connectionMongo,
connectionLogMongo,
MONGO_URL,
MONGO_LOG_URL
} from '@fastgpt/service/common/mongo';
import { initGlobalVariables } from '@/service/common/system';
import { afterAll, beforeAll, vi } from 'vitest';
import { setup, teardown } from 'vitest-mongodb';
@@ -63,7 +69,8 @@ beforeAll(async () => {
});
vi.stubEnv('MONGODB_URI', (globalThis as any).__MONGO_URI__);
initGlobalVariables();
await connectMongo();
await connectMongo(connectionMongo, MONGO_URL);
await connectMongo(connectionLogMongo, MONGO_LOG_URL);
// await getInitConfig();
if (existsSync('projects/app/.env.local')) {