修复 Native shell 作业在测试阶段才解析 crates.io index 的缺口
- .gitea/workflows/project-ci.yml:Native shell tests 新增「Prepare standalone Rust crate dependencies」步骤, 对被 server-rs workspace exclude 的 agent-runtime-core / agent-runtime-orchestration 先做 cargo fetch, 把它们在测试阶段的 registry 解析与下载提前到依赖准备阶段;两 crate 未提交 Cargo.lock,故不能带 --locked - scripts/project-ci-workflow.test.ts:新增用例钉住该步骤存在、覆盖两个独立 crate manifest、且命令不带锁标志 根因与影响见 #327:此前这两个 crate 只在 agent-runtime-*:check 中现场 `Updating crates.io index`, crates.io 一抖动整条 native shell 作业就红(PR #316 run 1950)。
This commit is contained in:
@@ -321,4 +321,26 @@ describe('project CI workflow', () => {
|
||||
expect(nativeJob).toContain('server-rs/Cargo.toml');
|
||||
expect(nativeJob).toContain('cargo fetch --locked');
|
||||
});
|
||||
|
||||
it('prefetches the excluded standalone Rust crates before the native shell gates', () => {
|
||||
const standaloneStep = stepSection(
|
||||
'native-shell-tests',
|
||||
'Prepare standalone Rust crate dependencies',
|
||||
);
|
||||
for (const manifest of [
|
||||
'server-rs/crates/agent-runtime-core/Cargo.toml',
|
||||
'server-rs/crates/agent-runtime-orchestration/Cargo.toml',
|
||||
]) {
|
||||
expect(standaloneStep).toContain(manifest);
|
||||
}
|
||||
// 这两个 crate 没有提交 Cargo.lock,只能用不带 --locked 的 fetch:
|
||||
// 带 --locked 会因为缺少锁文件直接失败。
|
||||
expect(standaloneStep).toContain('cargo fetch \\');
|
||||
expect(standaloneStep).not.toContain('cargo fetch --locked');
|
||||
|
||||
const nativeJob = jobSection('native-shell-tests');
|
||||
expect(
|
||||
nativeJob.indexOf('Prepare standalone Rust crate dependencies'),
|
||||
).toBeLessThan(nativeJob.indexOf('run: npm run check:native-shells'));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user