Skip to content
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

Merged
merged 15 commits into from
Sep 29, 2020

Conversation

xiaozhenliu-gg5
Copy link
Contributor

@xiaozhenliu-gg5 xiaozhenliu-gg5 commented Sep 8, 2020

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.

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 8, 2020
@xiaozhenliu-gg5 xiaozhenliu-gg5 changed the title [ggj][test][1/4]feat: move the expected string class in unit test to golden files [ggj][test][4/5]feat: move the expected string class in unit test to golden files Sep 9, 2020
@xiaozhenliu-gg5 xiaozhenliu-gg5 changed the title [ggj][test][4/5]feat: move the expected string class in unit test to golden files [ggj][test][4/5]feat: move the expected string in unit test to golden files Sep 23, 2020
@xiaozhenliu-gg5 xiaozhenliu-gg5 changed the title [ggj][test][4/5]feat: move the expected string in unit test to golden files [ggj][infra][4/5]feat: move the expected string in unit test to golden files Sep 23, 2020
@@ -37,8 +37,9 @@ java_proto_library(

[java_test(
name = test_name,
srcs = ["{0}.java".format(test_name)],
srcs = glob(["*.java"]),
data = [
Copy link
Contributor Author

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.

Copy link
Contributor

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",
]

Copy link
Contributor Author

@xiaozhenliu-gg5 xiaozhenliu-gg5 Sep 25, 2020

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

Copy link
Contributor Author

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.

Copy link
Contributor

@miraleung miraleung left a 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 = [
Copy link
Contributor

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",
]

@xiaozhenliu-gg5 xiaozhenliu-gg5 merged commit 71ac86f into master Sep 29, 2020
@xiaozhenliu-gg5 xiaozhenliu-gg5 deleted the add_golden_files branch September 29, 2020 01:08
suztomo pushed a commit that referenced this pull request Dec 16, 2022
…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://togithub.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://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#&#8203;127-httpsgithubcomgoogleapisjava-shared-configcomparev126v127-2022-02-04)

[Compare Source](https://togithub.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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants