mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:50:42 +00:00
test: harden release live probes
This commit is contained in:
@@ -31,6 +31,11 @@ const describeLive = LIVE ? describe : describe.skip;
|
||||
const providerFilter = parseCsvFilter(process.env.OPENCLAW_LIVE_IMAGE_GENERATION_PROVIDERS);
|
||||
const caseFilter = parseCaseFilter(process.env.OPENCLAW_LIVE_IMAGE_GENERATION_CASES);
|
||||
const envModelMap = parseProviderModelMap(process.env.OPENCLAW_LIVE_IMAGE_GENERATION_MODELS);
|
||||
const DEFAULT_LIVE_IMAGE_GENERATION_TIMEOUT_MS = 120_000;
|
||||
const LIVE_IMAGE_GENERATION_TIMEOUT_MS = resolvePositiveIntegerEnv(
|
||||
process.env.OPENCLAW_LIVE_IMAGE_GENERATION_TIMEOUT_MS,
|
||||
DEFAULT_LIVE_IMAGE_GENERATION_TIMEOUT_MS,
|
||||
);
|
||||
|
||||
type LiveProviderCase = {
|
||||
pluginId: string;
|
||||
@@ -48,6 +53,14 @@ type LiveImageCase = {
|
||||
inputImages?: Array<{ buffer: Buffer; mimeType: string; fileName?: string }>;
|
||||
};
|
||||
|
||||
function resolvePositiveIntegerEnv(raw: string | undefined, fallback: number): number {
|
||||
if (!raw) {
|
||||
return fallback;
|
||||
}
|
||||
const parsed = Number(raw);
|
||||
return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : fallback;
|
||||
}
|
||||
|
||||
function loadBundledProviderPlugin(
|
||||
pluginId: string,
|
||||
): ReturnType<typeof loadBundledProviderPluginFromTestHelper> {
|
||||
@@ -255,7 +268,7 @@ describeLive("image generation live (provider sweep)", () => {
|
||||
size: testCase.size,
|
||||
resolution: testCase.resolution,
|
||||
inputImages: testCase.inputImages,
|
||||
timeoutMs: 60_000,
|
||||
timeoutMs: LIVE_IMAGE_GENERATION_TIMEOUT_MS,
|
||||
});
|
||||
|
||||
expect(result.images.length).toBeGreaterThan(0);
|
||||
@@ -293,6 +306,6 @@ describeLive("image generation live (provider sweep)", () => {
|
||||
}
|
||||
expect(failures).toEqual([]);
|
||||
},
|
||||
10 * 60_000,
|
||||
15 * 60_000,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user