← Back to PRs

#22178: test(web): allow fixture roots in media local file tests

by Kansodata open 2026-02-20 20:50 View on GitHub →
channel: discord channel: msteams channel: whatsapp-web size: S
## Summary - Problem: `src/web/media.test.ts` local-file fixtures are created under OS temp directories, but stricter local media root checks now reject those paths in CI. - Why it matters: unit test jobs fail across node/bun/windows with `LocalMediaAccessError` before unrelated PRs can merge. - What changed: updated fixture-based local media tests to pass explicit `localRoots: [fixtureRoot]` for fixture reads. - Scope boundary: test-only change; runtime media loading behavior is unchanged. ## Change Type (select all) - [x] Bug fix - [ ] Feature - [ ] Refactor - [x] Docs - [ ] Security hardening - [x] Chore/infra ## Scope (select all touched areas) - [ ] Gateway / orchestration - [ ] Skills / tool execution - [ ] Auth / tokens - [ ] Memory / storage - [ ] Integrations - [ ] API / contracts - [x] UI / DX - [x] CI/CD / infra ## Linked Issue/PR - Closes # - Related #22154 ## Repro + Verification - Repro: run `pnpm test` on current main baseline and observe failures in `src/web/media.test.ts` with `LocalMediaAccessError`. - Verified: `pnpm exec vitest run src/web/media.test.ts --config vitest.unit.config.ts` passes after this change. <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixed test failures in `src/web/media.test.ts` by adding explicit `localRoots: [fixtureRoot]` to fixture-based tests. Tests were failing because stricter local media root checks (introduced in related work) now reject OS temp directory paths by default, but test fixtures are created under `os.tmpdir()`. The helper function `fixtureMediaOptions()` encapsulates this pattern cleanly. Also includes three unrelated changes bundled in this PR: - **Gateway refactor**: Extracted startup config bootstrap logic from `server.impl.ts` into a new `startup-config.ts` module with `prepareGatewayStartupConfig()` function - **Gateway test**: Added `server-methods-consistency.test.ts` to verify gateway method catalog consistency between `CORE_GATEWAY_METHODS` list and actual handlers - **Windows dev workflow**: Added `gateway-watch.mjs` script to provide portable watch mode for Windows developers (includes best-effort daemon stop to avoid port conflicts) - **Docs updates**: Updated README with mermaid architecture diagram (replacing ASCII), added Windows watch mode notes to debugging/setup docs All changes are test-only or dev-workflow improvements with no runtime behavior changes to production code. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with no concerns - All changes are test-only fixes and developer workflow improvements. The core fix properly addresses test failures by passing explicit `localRoots` to match the fixture location. Gateway refactoring is a clean extraction with no logic changes. New consistency test adds valuable guardrails. Windows watch script improves cross-platform dev experience. No production code behavior is modified. - No files require special attention <sub>Last reviewed commit: a454f89</sub> <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs