← Back to PRs

#7507: test(ci): make tests cross-platform (Windows) + add basic sanitization util

by ThinkIbrokeIt open 2026-02-02 22:20 View on GitHub →
agents
This PR makes a few tests more cross-platform-friendly (Windows PowerShell) and adds a small `sanitizeUserInput` helper for security-related flows: - Replace `printf` usage in agent tests with a Node-based `process.stdout.write` command so tests run on Windows PowerShell - Skip symlink test on Windows where creating symlinks often requires elevated privileges - Add `src/security/sanitization.ts` with `sanitizeUserInput` and unit tests All modified tests pass locally on Windows. This should reduce CI flakes on Windows runners and also provide the missing sanitization utility required by other changes. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adjusts a couple of tests to be more Windows-friendly (switching a shell `printf` to a `node -e process.stdout.write(...)` invocation, and skipping a symlink-related test on `win32`), and introduces a new `src/security/sanitization.ts` helper with accompanying unit tests. The changes are localized to tests plus the new sanitization utility under `src/security/`, and are aimed at reducing Windows CI flakes while providing a reusable sanitization function for security-sensitive flows. <h3>Confidence Score: 4/5</h3> - This PR looks safe to merge; changes are mostly test-only plus a small new helper, with a few minor behavior/coverage concerns to consider. - No obvious runtime-breaking changes were introduced; the main concerns are around the sanitization helper’s API semantics (dead type-check / potentially over-broad redaction) and reduced Windows security test coverage due to unconditional skipping. - src/security/sanitization.ts; src/media/server.test.ts <!-- greptile_other_comments_section --> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs