Improve test output and code sharing#3389
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the testing framework by centralizing comparison logic and improving error reporting for failed assertions. It also cleans up test code by removing redundant comparison functions and localizing test helper functions, leading to more maintainable and informative tests. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
cf0c662 to
e24a746
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors test utility functions by extracting a common compare module. This module provides a deep equality comparison function (compare.eq) and an EXISTS constant. Multiple test files (test/code_action/init.lua, test/completion/init.lua, test/crossfile/completion.lua, test/crossfile/hover.lua, test/crossfile/infer.lua, test/crossfile/references.lua) are updated to import and use this new compare module, removing their duplicate local implementations of eq and EXISTS. A minor improvement opportunity was identified in test/compare.lua regarding a misleading error message in the eq function.
test/compare.lua
Outdated
| end | ||
| for k in pairs(b) do | ||
| if not mark[k] then | ||
| return false, string.format(".%s: missing key in result", k) |
There was a problem hiding this comment.
|
Thank you! |
While working on a feature I noticed that test output could be more helpful. It now prints the expected and actual results for a failed test.
I also deduplicated some code that was copied across several tests, and made some uses of global
TESTvariables into locals.Example output: