test(fleet): make unreadable persona fixture deterministic
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { chmod, mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
||||||
import { tmpdir } from 'node:os';
|
import { tmpdir } from 'node:os';
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
@@ -132,16 +132,10 @@ describe('roster v2 semantic validation', (): void => {
|
|||||||
|
|
||||||
it('rejects an unreadable resolved persona', async () => {
|
it('rejects an unreadable resolved persona', async () => {
|
||||||
const dirs = await semanticDirs();
|
const dirs = await semanticDirs();
|
||||||
const file = join(dirs.overrideDir, 'worker.md');
|
await mkdir(join(dirs.overrideDir, 'worker.md'));
|
||||||
await writeFile(file, '# worker\n\n(`class: worker`)\n', 'utf8');
|
await expect(
|
||||||
await chmod(file, 0o000);
|
validateRosterV2Semantics(parseRosterV2(rosterWithClass('worker'), 'yaml'), dirs),
|
||||||
try {
|
).rejects.toThrow(/readable persona/i);
|
||||||
await expect(
|
|
||||||
validateRosterV2Semantics(parseRosterV2(rosterWithClass('worker'), 'yaml'), dirs),
|
|
||||||
).rejects.toThrow(/readable persona/i);
|
|
||||||
} finally {
|
|
||||||
await chmod(file, 0o600);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
|
|||||||
Reference in New Issue
Block a user