Repository navigation
fix(openai): use fs paths for embedded fixtures - #2484
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe fake OpenAI transformer now uses ChangesOpenAI fake response paths
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change corrects portable fixture lookup for OpenAI tests without altering response behavior, so it is mergeable. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
path.Joininstead offilepath.Joinfor fixtures read fromembed.FS.Problem
Names passed to
embed.FS.ReadFilefollow theio/fsconvention and always use forward slashes.filepath.Joinuses the host operating system's separator, so on Windows it produces names such astestdata\openai-stop.response.json.Those names do not identify the slash-separated fixtures in
embed.FS, causing bothTestFakeExecutor_DoandTestFakeExecutor_DoStreamto fail withfile does not existbefore exercising the transformer behavior.Using
path.Joinpreserves slash-separated embedded-FS names on every operating system.Related work
The same fixture-path correction previously appeared inside broader changes in #1940, #2312, and #2397, but it did not land in
unstable. This PR isolates only the portable fixture lookup change; the merged #2399 does not modifyfake.go.Validation
go test ./transformer/openai -run '^TestFakeExecutor_(Do|DoStream)$' -count=1 -vfailed both tests withtestdata\...: file does not exist.-count=5on the reviewedunstable@ad5b5eecbase (10 executions total).go test ./transformer/openai -count=1passed on the reviewedunstable@ad5b5eecbase.gofmt -d llm/transformer/openai/fake.goproduced no diff.git diff --checkpassed.go test ./... -count=1completed across thellmmodule. Every package passed excepttransformer/openai/responses, whose sole failing Windows WebSocket assertion also fails unchanged onunstable@ad5b5eec; it is unrelated to this one-file fixture-path change.Risk
The change is limited to embedded test-fixture lookup. It does not alter fixture data, request transformation, or response parsing.
Summary by CodeRabbit