合并编辑器素材库分支
合并 codex/editor-asset-library 到 master 保留原生壳桥接统一分支已合入内容 合并图片编辑器素材库、模型定价和项目记忆更新 解决项目记忆踩坑记录冲突
This commit is contained in:
+55
-1
@@ -1,4 +1,4 @@
|
||||
import {mkdtempSync, readFileSync, rmSync, writeFileSync} from 'node:fs';
|
||||
import {mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync} from 'node:fs';
|
||||
import {tmpdir} from 'node:os';
|
||||
import {join} from 'node:path';
|
||||
|
||||
@@ -214,6 +214,60 @@ describe('dev scheduler api-server env', () => {
|
||||
expect(env.GENARRATIVE_API_PORT).toBe('9091');
|
||||
expect(env.GENARRATIVE_SPACETIME_SERVER_URL).toBe('http://127.0.0.1:3199');
|
||||
});
|
||||
|
||||
test('Windows 本地 dev 自动注入已安装的 FFmpeg 路径', () => {
|
||||
const tempDir = mkdtempSync(join(tmpdir(), 'genarrative-ffmpeg-'));
|
||||
try {
|
||||
const binDir = join(tempDir, 'Genarrative', 'ffmpeg', 'bin');
|
||||
const ffmpegPath = join(binDir, 'ffmpeg.exe');
|
||||
const ffprobePath = join(binDir, 'ffprobe.exe');
|
||||
mkdirSync(binDir, {recursive: true});
|
||||
writeFileSync(ffmpegPath, '', 'utf8');
|
||||
writeFileSync(ffprobePath, '', 'utf8');
|
||||
|
||||
const {options} = parseArgs(['api-server'], {});
|
||||
const env = buildApiServerProcessEnv({
|
||||
baseEnv: {LOCALAPPDATA: tempDir, Path: 'C:\\Windows\\System32'},
|
||||
options,
|
||||
state: {spacetimeServer: 'http://127.0.0.1:3199'},
|
||||
platform: 'win32',
|
||||
});
|
||||
|
||||
expect(env.CHARACTER_ANIMATION_FFMPEG_PATH).toBe(ffmpegPath);
|
||||
expect(env.CHARACTER_ANIMATION_FFPROBE_PATH).toBe(ffprobePath);
|
||||
expect(env.GENARRATIVE_CHARACTER_ANIMATION_FFMPEG_PATH).toBe(ffmpegPath);
|
||||
expect(env.Path?.split(';')[0]).toBe(binDir);
|
||||
} finally {
|
||||
rmSync(tempDir, {recursive: true, force: true});
|
||||
}
|
||||
});
|
||||
|
||||
test('Windows 本地 dev 保留显式 FFmpeg 配置', () => {
|
||||
const tempDir = mkdtempSync(join(tmpdir(), 'genarrative-ffmpeg-'));
|
||||
try {
|
||||
const binDir = join(tempDir, 'Genarrative', 'ffmpeg', 'bin');
|
||||
mkdirSync(binDir, {recursive: true});
|
||||
writeFileSync(join(binDir, 'ffmpeg.exe'), '', 'utf8');
|
||||
writeFileSync(join(binDir, 'ffprobe.exe'), '', 'utf8');
|
||||
|
||||
const {options} = parseArgs(['api-server'], {});
|
||||
const env = buildApiServerProcessEnv({
|
||||
baseEnv: {
|
||||
LOCALAPPDATA: tempDir,
|
||||
CHARACTER_ANIMATION_FFMPEG_PATH: 'D:\\tools\\ffmpeg.exe',
|
||||
CHARACTER_ANIMATION_FFPROBE_PATH: 'D:\\tools\\ffprobe.exe',
|
||||
},
|
||||
options,
|
||||
state: {spacetimeServer: 'http://127.0.0.1:3199'},
|
||||
platform: 'win32',
|
||||
});
|
||||
|
||||
expect(env.CHARACTER_ANIMATION_FFMPEG_PATH).toBe('D:\\tools\\ffmpeg.exe');
|
||||
expect(env.CHARACTER_ANIMATION_FFPROBE_PATH).toBe('D:\\tools\\ffprobe.exe');
|
||||
} finally {
|
||||
rmSync(tempDir, {recursive: true, force: true});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('dev scheduler Rust build env', () => {
|
||||
|
||||
Reference in New Issue
Block a user