test(reporting): skip read-only write check when running as root
Deploy / Test, build & deploy (push) Successful in 3m28s
Details
Deploy / Test, build & deploy (push) Successful in 3m28s
Details
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
47c23a8c6e
commit
925ce6c276
|
|
@ -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