-
Notifications
You must be signed in to change notification settings - Fork 662
dataconnect: testing: freeze mutable lists in tests to improve readability #7630
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
Conversation
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. |
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
Coverage Report 1Affected ProductsNo changes between base commit (6dab936) and merge commit (e3accd2).Test Logs |
|
/gemini review |
|
/gemini summary |
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.
Code Review
This pull request improves the robustness and readability of the test code by converting a mutable list of differences into an immutable one immediately after it's populated. This is a great practice as it prevents potential accidental modifications later in the test, making the code more robust and its intent clearer. The changes are correct and well-implemented. I have no further suggestions.
Summary of ChangesThis pull request enhances the readability and robustness of property-based tests within the 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. Changelog
Activity
|
This PR enhances the readability and robustness of Data Connect's property-based tests within the
ProtoDiffUnitTestby ensuring that lists representing expected differences are treated as immutable once defined. This change prevents any subsequent modifications from affecting the test's assertion logic.Highlights
.toList()inProtoDiffUnitTestto clearly define expected differences and prevent unintended modifications during test execution.Changelog
expectedDifferences = mutableDifferencestoexpectedDifferences = mutableDifferences.toList()in twocheckAlltest blocks to freeze the list of differences.