Merge branch 'master' of https://git.genarrative.world/git/GenarrativeAI/Genarrative
Project CI / AI game creator shell Rust crates (push) Successful in 1m24s
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / AI game creator shell Rust smoke (push) Has been cancelled

This commit is contained in:
kdletters
2026-10-01 19:45:43 +08:00
5 changed files with 22 additions and 2 deletions
@@ -156,7 +156,8 @@ function resolveTestExecutable() {
kind: options.targetKind,
name: options.binName,
});
cargoArguments.push('--no-run', '--message-format=json');
// 保留 stdout 的 artifact JSON,并由 Cargo 将编译诊断输出到继承的 stderr。
cargoArguments.push('--no-run', '--message-format=json-render-diagnostics');
console.log(`[rust-shards] cargo ${cargoArguments.join(' ')}`);
const child = spawn('cargo', cargoArguments, {
@@ -62,6 +62,18 @@ fn failing_case() {
assert.match(result.output, /1 passed; 1 failed/);
});
test('compile failure retains the diagnostic code, source location and cause', (t) => {
const result = runFixture(
t,
'#[test]\nfn compile_failure() { let _: u32 = "not a number"; }\n',
);
assert.equal(result.status, 1, result.output);
assert.match(result.output, /error\[E0308\]/);
assert.match(result.output, /src[\\/]lib\.rs:2:/);
assert.match(result.output, /mismatched types/);
assert.match(result.output, /expected `u32`, found `&str`/);
});
test('successful shard keeps its compact summary', (t) => {
const result = runFixture(t, '#[test]\nfn passing_case() {}\n');
assert.equal(result.status, 0, result.output);
@@ -912,7 +912,6 @@ mod tests {
let error = parse_direct_stream_result(
br#"{"type":"result","is_error":true,"result":"Authentication failed"}
"#,
"turn-1",
None,
)
.expect_err("failed terminal must be rejected");