CI : workflow validate.yml, manifeste ci.required:true, garde VITEST, tests isolés

This commit is contained in:
Manus CI
2026-08-21 10:31:45 +00:00
committed by manus-admin
parent a9cea0ecbb
commit 5c8237d5c6
6 changed files with 61 additions and 5 deletions

View File

@@ -406,4 +406,7 @@ async function startServer() {
}, 5000); // Attendre 5s que le serveur soit prêt
}
startServer().catch(console.error);
// Vitest ne doit jamais démarrer un serveur HTTP.
if (!process.env.VITEST) {
startServer().catch(console.error);
}

View File

@@ -1224,6 +1224,8 @@ export async function updateWebImportSourceStatus(
* Used to prevent duplicate file storage during email import
*/
export async function findSourceFileByFileName(userId: number, fileName: string): Promise<any | null> {
const db = await getDb();
if (!db) return null;
const result = await db.select()
.from(sourceFiles)
.where(and(

View File

@@ -1,11 +1,13 @@
import { describe, it, expect, beforeAll } from "vitest";
const describeIntegration = process.env.DATABASE_URL ? describe : describe.skip;
import {
getLlmFieldsConfigByUser,
upsertLlmFieldConfig,
initializeDefaultLlmFields
} from "./db";
describe("LLM Fields Configuration", () => {
describeIntegration("LLM Fields Configuration", () => {
const testUserId = 99999; // Use a high ID to avoid conflicts
beforeAll(async () => {