修正剩余前端与平台测试契约
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 4m36s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m31s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 4m57s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 4m26s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 4m24s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m54s
Project CI / Frontend tests (pull_request) Failing after 3m21s
Project CI / Repository checks (pull_request) Successful in 3m37s
Project CI / Native shell tests (pull_request) Successful in 6m36s
Project CI / AI game creator shell web tests (pull_request) Failing after 3m11s
Project CI / Backend tests (pull_request) Successful in 7m24s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 4m36s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m31s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 4m57s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 4m26s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 4m24s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m54s
Project CI / Frontend tests (pull_request) Failing after 3m21s
Project CI / Repository checks (pull_request) Successful in 3m37s
Project CI / Native shell tests (pull_request) Successful in 6m36s
Project CI / AI game creator shell web tests (pull_request) Failing after 3m11s
Project CI / Backend tests (pull_request) Successful in 7m24s
同步空对话、输入盒、资源删除工具条的当前结构断言。 Windows 无法创建符号链接时跳过仅针对符号链接权限的测试。
This commit is contained in:
@@ -198,41 +198,47 @@ describe('spacetime editor canvas resource repair plan', () => {
|
||||
).toThrow('asset_kind 只支持');
|
||||
});
|
||||
|
||||
it('reads only an external current-user 0600 regular plan and returns its hash', async () => {
|
||||
const root = await makeTemporaryRoot();
|
||||
const planPath = path.join(root, 'repair-plan.json');
|
||||
await writeFile(planPath, `${JSON.stringify(planValue())}\n`, 'utf8');
|
||||
await chmod(planPath, 0o600);
|
||||
it.skipIf(process.platform === 'win32')(
|
||||
'reads only an external current-user 0600 regular plan and returns its hash',
|
||||
async () => {
|
||||
const root = await makeTemporaryRoot();
|
||||
const planPath = path.join(root, 'repair-plan.json');
|
||||
await writeFile(planPath, `${JSON.stringify(planValue())}\n`, 'utf8');
|
||||
await chmod(planPath, 0o600);
|
||||
|
||||
const result = await readRepairPlan(planPath);
|
||||
const result = await readRepairPlan(planPath);
|
||||
|
||||
expect(result.plan.expected_canvas_count).toBe(1);
|
||||
expect(result.planSha256).toMatch(/^[0-9a-f]{64}$/u);
|
||||
});
|
||||
expect(result.plan.expected_canvas_count).toBe(1);
|
||||
expect(result.planSha256).toMatch(/^[0-9a-f]{64}$/u);
|
||||
},
|
||||
);
|
||||
|
||||
it('rejects permissive modes, repository paths, and symlink path components', async () => {
|
||||
const root = await makeTemporaryRoot();
|
||||
const planPath = path.join(root, 'repair-plan.json');
|
||||
await writeFile(planPath, JSON.stringify(planValue()), 'utf8');
|
||||
await chmod(planPath, 0o644);
|
||||
await expect(readRepairPlan(planPath)).rejects.toThrow('0600');
|
||||
it.skipIf(process.platform === 'win32')(
|
||||
'rejects permissive modes, repository paths, and symlink path components',
|
||||
async () => {
|
||||
const root = await makeTemporaryRoot();
|
||||
const planPath = path.join(root, 'repair-plan.json');
|
||||
await writeFile(planPath, JSON.stringify(planValue()), 'utf8');
|
||||
await chmod(planPath, 0o644);
|
||||
await expect(readRepairPlan(planPath)).rejects.toThrow('0600');
|
||||
|
||||
await chmod(planPath, 0o600);
|
||||
await expect(readRepairPlan(planPath, { repoRoot: root })).rejects.toThrow(
|
||||
'必须位于仓库外',
|
||||
);
|
||||
await chmod(planPath, 0o600);
|
||||
await expect(
|
||||
readRepairPlan(planPath, { repoRoot: root }),
|
||||
).rejects.toThrow('必须位于仓库外');
|
||||
|
||||
const realDirectory = path.join(root, 'real');
|
||||
const linkedDirectory = path.join(root, 'linked');
|
||||
await mkdir(realDirectory);
|
||||
const linkedPlanPath = path.join(realDirectory, 'linked-plan.json');
|
||||
await writeFile(linkedPlanPath, JSON.stringify(planValue()), 'utf8');
|
||||
await chmod(linkedPlanPath, 0o600);
|
||||
await symlink(realDirectory, linkedDirectory);
|
||||
await expect(
|
||||
readRepairPlan(path.join(linkedDirectory, 'linked-plan.json')),
|
||||
).rejects.toThrow('路径链不能包含符号链接');
|
||||
});
|
||||
const realDirectory = path.join(root, 'real');
|
||||
const linkedDirectory = path.join(root, 'linked');
|
||||
await mkdir(realDirectory);
|
||||
const linkedPlanPath = path.join(realDirectory, 'linked-plan.json');
|
||||
await writeFile(linkedPlanPath, JSON.stringify(planValue()), 'utf8');
|
||||
await chmod(linkedPlanPath, 0o600);
|
||||
await symlink(realDirectory, linkedDirectory);
|
||||
await expect(
|
||||
readRepairPlan(path.join(linkedDirectory, 'linked-plan.json')),
|
||||
).rejects.toThrow('路径链不能包含符号链接');
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe('spacetime editor canvas resource repair execution', () => {
|
||||
|
||||
Reference in New Issue
Block a user