-
Notifications
You must be signed in to change notification settings - Fork 54
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
[ggj][infra][4/5]feat: move the expected string in unit test to golden files #279
Conversation
src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java
Outdated
Show resolved
Hide resolved
...ava/com/google/api/generator/gapic/composer/GrpcServiceCallableFactoryClassComposerTest.java
Outdated
Show resolved
Hide resolved
...ava/com/google/api/generator/gapic/composer/GrpcServiceCallableFactoryClassComposerTest.java
Outdated
Show resolved
Hide resolved
...ava/com/google/api/generator/gapic/composer/GrpcServiceCallableFactoryClassComposerTest.java
Outdated
Show resolved
Hide resolved
@@ -37,8 +37,9 @@ java_proto_library( | |||
|
|||
[java_test( | |||
name = test_name, | |||
srcs = ["{0}.java".format(test_name)], | |||
srcs = glob(["*.java"]), | |||
data = [ |
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.
This change is for including ComposerConstants.java
as src, not only the tests files.
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.
How about:
srcs = [
"{0}.java".format(test_name)",
"ComposerConstants.java",
]
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.
Thanks! That should also work, while if we add more helpers, those files have to be explicitly included. By using glob(["*.java"])
we can avoid modifying this even if more files are added. WDYT? @miraleung
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.
Done! Talked offline and for suggested option, we can avoid including other test files.
…nto add_golden_files
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.
LGTM with BUILD
file comment.
\o/ looks great!
@@ -37,8 +37,9 @@ java_proto_library( | |||
|
|||
[java_test( | |||
name = test_name, | |||
srcs = ["{0}.java".format(test_name)], | |||
srcs = glob(["*.java"]), | |||
data = [ |
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.
How about:
srcs = [
"{0}.java".format(test_name)",
"ComposerConstants.java",
]
…onfig to v1.2.7 (#279) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://github.com/googleapis/java-shared-config) | `1.2.6` -> `1.2.7` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.7/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.7/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.7/compatibility-slim/1.2.6)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.7/confidence-slim/1.2.6)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/java-shared-config</summary> ### [`v1.2.7`](https://github.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​127-httpsgithubcomgoogleapisjava-shared-configcomparev126v127-2022-02-04) [Compare Source](https://github.com/googleapis/java-shared-config/compare/v1.2.6...v1.2.7) </details> --- ### Configuration 📅 **Schedule**: 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, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam).
Find more details in design doc: go/java-micro-file-diff-infra
Move the expected codegen string into goldens files, no logic for updating goldens is included.
update_golden bazel rules for each unit test will be coming once #314 merged in.