test(reporting): skip read-only write check when running as root
CI job containers run as root, which bypasses file permission bits. The mode check still verifies the archived file has no write bits.
This commit is contained in:
parent
44905c84a6
commit
065ac3ac13
|
|
@ -43,7 +43,8 @@ describe('Report archive', () => {
|
|||
expect(renderReportFiles(archived.projection)).toEqual(run.files);
|
||||
const file = join(projectDirectory, manifest.runId, REPORT_ARCHIVE_FILES.management);
|
||||
expect((await stat(file)).mode & 0o222).toBe(0);
|
||||
await expect(writeFile(file, 'changed')).rejects.toThrow();
|
||||
// Root (e.g. a CI job container) bypasses file permission bits; the mode check above still applies.
|
||||
if (process.getuid?.() !== 0) await expect(writeFile(file, 'changed')).rejects.toThrow();
|
||||
});
|
||||
|
||||
it('detects a changed archived file instead of trusting it', async () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue