mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-21 09:58:46 +08:00
fix(ql3): install alpha finalizer dependencies
This commit is contained in:
@@ -325,6 +325,35 @@ test('workflow audit rejects a partial milestone finalizer', (t) => {
|
||||
);
|
||||
});
|
||||
|
||||
test('workflow audit rejects a finalizer without installed dependencies', (t) => {
|
||||
const fixtureRoot = fs.realpathSync(
|
||||
fs.mkdtempSync(path.join(os.tmpdir(), 'ql3-local-alpha-dependencies-')),
|
||||
);
|
||||
t.after(() => fs.rmSync(fixtureRoot, { recursive: true, force: true }));
|
||||
fs.mkdirSync(path.join(fixtureRoot, '.github/workflows'), {
|
||||
recursive: true,
|
||||
});
|
||||
const source = fs.readFileSync(
|
||||
path.join(root, '.github/workflows/ql3-ci.yml'),
|
||||
'utf8',
|
||||
);
|
||||
const marker = '\n local-alpha-milestone:\n';
|
||||
const markerIndex = source.indexOf(marker);
|
||||
const workflow = `${source.slice(0, markerIndex)}${source
|
||||
.slice(markerIndex)
|
||||
.replace('pnpm install --frozen-lockfile --ignore-scripts', 'true')}`;
|
||||
fs.writeFileSync(
|
||||
path.join(fixtureRoot, '.github/workflows/ql3-ci.yml'),
|
||||
workflow,
|
||||
);
|
||||
const report = auditLocalAlphaMilestoneWorkflow(fixtureRoot);
|
||||
assert.equal(report.compatible, false);
|
||||
assert.equal(
|
||||
report.findings.includes('MILESTONE_FINALIZER_CONTRACT_DRIFT'),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test('CLI grammar separates finalization, index audit and workflow audit', () => {
|
||||
assert.deepEqual(
|
||||
parseArguments(['--mode=audit', '--milestone=/tmp/ql3-alpha-milestone']),
|
||||
|
||||
Reference in New Issue
Block a user