25898969fb
Project CI / AI game creator shell Rust crates (push) Successful in 1m30s
Project CI / AI game creator shell Rust smoke (push) Successful in 2m1s
Project CI / Backend tests (push) Successful in 4m21s
Project CI / Frontend tests (push) Successful in 2m23s
Project CI / Native shell tests (push) Successful in 6m43s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 9m17s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 9m48s
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
- 新增 scripts/run-agc-direct-execution-fixture.mjs:默认用 src-tauri/target/debug 的 AGC 二进制跑全部 11 个用例,支持 -- --cases 子集与 -- --agc-exe 覆盖;二进制缺失时给出构建提示并以退出码 2 结束 - package.json 注册 npm run check:agc-direct-execution-fixture - 复验:全量 11/11 passed(completed/passes/mcp/mcp-write/native/native-resources/patch/deadline/native-session/restart/running);-- --cases restart 透传也通过 - DirectProject 里程碑记录该可复跑入口与 11/11 结果
72 lines
2.4 KiB
JavaScript
72 lines
2.4 KiB
JavaScript
// 真机 DirectProject 执行夹具的一键入口:真 AGC CLI → 真 app-server → loopback Responses
|
||
// fixtures,不需要账号、不花付费 Provider。
|
||
//
|
||
// 与 `apps/ai-game-creator-shell/scripts/direct-execution-production-fixture.mjs` 的区别:
|
||
// 那个夹具必须显式传 `--agc-exe`;这里默认用工作区里已构建的 debug 二进制,省掉每次手打路径。
|
||
//
|
||
// 用法:
|
||
// npm run check:agc-direct-execution-fixture # 默认跑全部用例
|
||
// npm run check:agc-direct-execution-fixture -- --cases restart # 透传夹具参数
|
||
// npm run check:agc-direct-execution-fixture -- --agc-exe <path> # 指定其它二进制
|
||
//
|
||
// 前置:先构建 debug 二进制(`cargo build --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml`)。
|
||
import { spawnSync } from 'node:child_process';
|
||
import { existsSync } from 'node:fs';
|
||
import path from 'node:path';
|
||
import { fileURLToPath } from 'node:url';
|
||
|
||
const repoRoot = path.resolve(
|
||
path.dirname(fileURLToPath(import.meta.url)),
|
||
'..',
|
||
);
|
||
const fixture = path.join(
|
||
repoRoot,
|
||
'apps/ai-game-creator-shell/scripts/direct-execution-production-fixture.mjs',
|
||
);
|
||
const defaultExecutable = path.join(
|
||
repoRoot,
|
||
'apps/ai-game-creator-shell/src-tauri/target/debug',
|
||
process.platform === 'win32'
|
||
? 'genarrative-ai-game-creator-shell.exe'
|
||
: 'genarrative-ai-game-creator-shell',
|
||
);
|
||
const defaultCases = [
|
||
'completed',
|
||
'passes',
|
||
'mcp',
|
||
'mcp-write',
|
||
'native',
|
||
'native-resources',
|
||
'patch',
|
||
'deadline',
|
||
'native-session',
|
||
'restart',
|
||
'running',
|
||
].join(',');
|
||
|
||
const forwarded = process.argv.slice(2);
|
||
const hasExecutable = forwarded.some(
|
||
(value) => value === '--agc-exe' || value.startsWith('--agc-exe='),
|
||
);
|
||
const hasCases = forwarded.some(
|
||
(value) => value === '--cases' || value.startsWith('--cases='),
|
||
);
|
||
if (!hasExecutable && !existsSync(defaultExecutable)) {
|
||
console.error(
|
||
`未找到 debug 二进制:${defaultExecutable}\n` +
|
||
'请先执行 `cargo build --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml`,' +
|
||
'或用 `-- --agc-exe <path>` 指定一个已构建的 AGC 二进制。',
|
||
);
|
||
process.exit(2);
|
||
}
|
||
|
||
const args = [fixture, ...forwarded];
|
||
if (!hasExecutable) args.push('--agc-exe', defaultExecutable);
|
||
if (!hasCases) args.push('--cases', defaultCases);
|
||
|
||
const result = spawnSync(process.execPath, args, {
|
||
cwd: repoRoot,
|
||
stdio: 'inherit',
|
||
});
|
||
process.exit(result.status ?? 1);
|