Sidecar leak check: skip a generic build home (/root in a CI container is a substring of the bun runtime itself); privacy-scan still checks every home
This commit is contained in:
parent
d813cf1dbd
commit
c4d596fe8a
2 changed files with 12 additions and 3 deletions
|
|
@ -12,7 +12,7 @@ import { draftMarkdown, draftName, parseDraft } from '../cli/lib/reviews';
|
|||
import { findIcon, iconCandidates, iconDataUrl, listingCompleteness, readReplyDrafts, setApproved } from '../cli/lib/project-files';
|
||||
import { TEMPLATE_TEXT } from '../cli/lib/template-files';
|
||||
import { installCommands } from '../cli/lib/tools';
|
||||
import { NEUTRAL_ROOT, neutralize } from '../tools/build-sidecars';
|
||||
import { NEUTRAL_ROOT, neutralize, privateStrings } from '../tools/build-sidecars';
|
||||
|
||||
const ROOT = join(import.meta.dir, '..');
|
||||
const tmp = () => mkdtempSync(join(tmpdir(), 'sb-d2-'));
|
||||
|
|
@ -145,6 +145,11 @@ describe('doctor and playwright', () => {
|
|||
const js = 'var a = __require.resolve("/work/sb/node_modules/x/package.json"); var __dirname = "/work/sb/node_modules/x/lib";';
|
||||
expect(neutralize(js, '/work/sb')).toBe(`var a = "${NEUTRAL_ROOT}/node_modules/x/package.json"; var __dirname = "${NEUTRAL_ROOT}/node_modules/x/lib";`);
|
||||
});
|
||||
test('sidecar leak check: a person\'s home and the checkout, not a CI container\'s /root', () => {
|
||||
expect(privateStrings('/Users/you', '/work/sb')).toEqual(['/Users/you', '/work/sb']);
|
||||
expect(privateStrings('/root', '/workspace/o/sb')).toEqual(['/workspace/o/sb']);
|
||||
expect(privateStrings('/home/runner', '/home/runner/work/sb')).toEqual(['/home/runner/work/sb']);
|
||||
});
|
||||
test('install commands per OS, never empty for the tools that have a package', () => {
|
||||
expect(installCommands('ffmpeg', 'darwin')).toEqual(['brew install ffmpeg']);
|
||||
expect(installCommands('ffmpeg', 'win32')[0]).toContain('winget');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue