-
Notifications
You must be signed in to change notification settings - Fork 53
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
test(Spring CodeGen): Set up golden file tests for spring class composers #1052
Conversation
@zhumin8 Two open questions for this PR:
Was there a consideration for keeping the explicit setup steps here (perhaps for things that’d need customizing or flexibility in the future?) If not, I'll make the switch over in this PR. |
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.
Great work! this will make our work a lot easier when making changes to the Composer classes.
I only got one comment:
The setups for the three existing tests are exactly the same. Perhaps it makes sense to have an Abstract test class with the setups and each extend from it. This way if we ever want to test on more edge-cases in future, we are able to add the scenario to all test in sync.
On your questions above:
- Changes to
SpringComposer
I have in mind now: 1) add package-info composer 2)extracting the@Generated("by gapic-generator-java")
here instead of individual class composers. 3)perhaps add a new class composer for a shared property class.
Either way, I would say combine and reuse is fine. Unless it causes trouble setting updates to golden files. Also, I don't have to strong a preference here, now that with golden files, they can be updated. - Great find! No particular reason. Your replacement is better. (I probably started out there testing around and lost track of the origin entirely)
BUILD.bazel
Outdated
@@ -208,6 +208,9 @@ GOLDEN_UPDATING_UNIT_TESTS = [ | |||
"com.google.api.generator.gapic.composer.rest.ServiceClientTestClassComposerTest", | |||
"com.google.api.generator.gapic.composer.rest.ServiceSettingsClassComposerTest", | |||
"com.google.api.generator.gapic.composer.rest.ServiceStubSettingsClassComposerTest", | |||
"com.google.api.generator.spring.SpringAutoConfigClassComposerTest", |
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.
just a note for future: we will need to carry this update logic over if we separate from gapic-generator-java.
@zhumin8 Thank you for the review! A quick summary of follow-up changes to the PR:
|
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.
Changes looks good. Agreed on your reasoning on keeping separate golden files.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.threeten:threetenbp](https://www.threeten.org/threetenbp) ([source](https://togithub.com/ThreeTen/threetenbp)) | `1.6.4` -> `1.6.5` | [![age](https://badges.renovateapi.com/packages/maven/org.threeten:threetenbp/1.6.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.threeten:threetenbp/1.6.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.threeten:threetenbp/1.6.5/compatibility-slim/1.6.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.threeten:threetenbp/1.6.5/confidence-slim/1.6.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ThreeTen/threetenbp</summary> ### [`v1.6.5`](https://togithub.com/ThreeTen/threetenbp/releases/tag/v1.6.5) [Compare Source](https://togithub.com/ThreeTen/threetenbp/compare/v1.6.4...v1.6.5) See the [change notes](https://www.threeten.org/threetenbp/changes-report.html) for more information. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-core). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
In this PR:
SpringPropertiesClassComposerTest
fromSpringAutoConfigClassComposerTest
To update golden files:
Potential conflicts: