Skip to content

Commit 1303df4

Browse files
committed
test: backport current CI fixture fixes for PR 90898
1 parent 5058a7c commit 1303df4

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

‎extensions/google/google.live.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { resolveFfmpegBin } from "openclaw/plugin-sdk/media-runtime";
12
// Google tests cover google plugin behavior.
23
import {
34
registerProviderPlugin,
@@ -49,6 +50,20 @@ function isTransientGeminiSearchError(error: unknown): boolean {
4950
return message.includes("timeout") || message.includes("aborted");
5051
}
5152

53+
function hasTrustedFfmpegForLiveVoiceNote(): boolean {
54+
try {
55+
resolveFfmpegBin();
56+
return true;
57+
} catch (error) {
58+
const message = error instanceof Error ? error.message : String(error);
59+
if (message.includes("ffmpeg not found in trusted system directories")) {
60+
console.warn("[google:live] skip voice-note transcode: ffmpeg unavailable");
61+
return false;
62+
}
63+
throw error;
64+
}
65+
}
66+
5267
const registerGooglePlugin = () =>
5368
registerProviderPlugin({
5469
plugin,
@@ -75,6 +90,10 @@ describeLive("google plugin live", () => {
7590
}, 120_000);
7691

7792
it("transcodes speech to Opus for voice-note targets", async () => {
93+
if (!hasTrustedFfmpegForLiveVoiceNote()) {
94+
return;
95+
}
96+
7897
const { speechProviders } = await registerGooglePlugin();
7998
const provider = requireRegisteredProvider(speechProviders, "google");
8099

‎extensions/minimax/minimax.live.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { resolveFfmpegBin } from "openclaw/plugin-sdk/media-runtime";
12
// Minimax tests cover minimax plugin behavior.
23
import {
34
registerProviderPlugin,
@@ -35,6 +36,20 @@ const registerMinimaxPlugin = () =>
3536
name: "MiniMax Provider",
3637
});
3738

39+
function hasTrustedFfmpegForLiveVoiceNote(): boolean {
40+
try {
41+
resolveFfmpegBin();
42+
return true;
43+
} catch (error) {
44+
const message = error instanceof Error ? error.message : String(error);
45+
if (message.includes("ffmpeg not found in trusted system directories")) {
46+
console.warn("[minimax:live] skip voice-note transcode: ffmpeg unavailable");
47+
return false;
48+
}
49+
throw error;
50+
}
51+
}
52+
3853
describeLive("minimax plugin live", () => {
3954
it("runs MiniMax web search through the provider tool", async () => {
4055
const provider = createMiniMaxWebSearchProvider();
@@ -70,6 +85,10 @@ describeTtsLive("minimax tts live", () => {
7085
}, 120_000);
7186

7287
it("synthesizes MiniMax TTS as an Opus voice note", async () => {
88+
if (!hasTrustedFfmpegForLiveVoiceNote()) {
89+
return;
90+
}
91+
7392
const provider = buildMinimaxSpeechProvider();
7493

7594
const voiceNote = await provider.synthesize({

‎src/agents/openclaw-tools.camera.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ const { callGateway } = vi.hoisted(() => ({
1212

1313
vi.mock("../gateway/call.js", () => ({ callGateway }));
1414
vi.mock("../media/media-services.js", () => ({
15+
buildImageResizeSideGrid: vi.fn(() => [1200]),
1516
getImageMetadata: vi.fn(async () => ({ width: 1, height: 1 })),
17+
IMAGE_REDUCE_QUALITY_STEPS: [85],
18+
isImageProcessorUnavailableError: vi.fn(() => false),
19+
MAX_IMAGE_INPUT_PIXELS: 25_000_000,
20+
readImageMetadataFromHeader: vi.fn(() => ({ width: 1, height: 1 })),
1621
resizeToJpeg: vi.fn(async () => Buffer.from("jpeg")),
1722
}));
1823

0 commit comments

Comments
 (0)