-
Notifications
You must be signed in to change notification settings - Fork 151
chore: use goldie fixture as expected response #1278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: use goldie fixture as expected response #1278
Conversation
This change fixes the introspection benchmark. Use the goldie fixture: full_introspection.json It corresponds to the test "execute full introspection query".
WalkthroughReplace inline expected JSON in BenchmarkIntrospection with a fixture read from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
execution/engine/execution_engine_test.go (1)
4642-4644
: Avoid skewing the benchmark when validating mismatchesIf bytes.Equal fails, JSONEq unmarshals and compares JSON, which is relatively heavy. Wrap that check with b.StopTimer()/b.StartTimer() so validation doesn’t contaminate timing. With the json.Compact change above, bytes.Equal should pass and this path won’t be hit, but the guard keeps the benchmark robust.
Apply this diff:
- if !bytes.Equal(expectedResponse, bc.writer.Bytes()) { - require.JSONEq(b, string(expectedResponse), bc.writer.String()) - } + if !bytes.Equal(expectedResponse, bc.writer.Bytes()) { + b.StopTimer() + require.JSONEq(b, string(expectedResponse), bc.writer.String()) + b.StartTimer() + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
execution/engine/execution_engine_test.go
(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build and test (go 1.23 / ubuntu-latest)
- GitHub Check: Build and test (go 1.23 / windows-latest)
🔇 Additional comments (2)
execution/engine/execution_engine_test.go (2)
12-12
: Import looks correct for reading the goldie fixtureAdding os is appropriate for using os.ReadFile in the benchmark setup.
4625-4625
: Good switch to JSON-aware comparisonUsing require.JSONEq here prevents failures due to insignificant formatting differences between the engine output and the fixture.
This change fixes the introspection benchmark.
Use the goldie fixture: full_introspection.json
It corresponds to the test "execute full introspection query".
Summary by CodeRabbit