Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

xiaozhenliu-gg5
Copy link
Contributor

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

Find more details in design doc: go/java-micro-file-diff-infra

  1. Add a unit test for testing the future implementation (so that we do not have to touch the real unit test).
  2. Add golden files for the two unit tests in new-added test class.

The following step would be:

  1. Integrate the library (java_diff_utils) with the unit tests for extracting the diff between golden files and actual codegen. DiffUtils, AssertUtils will be added as wrappers.
  2. Add bazel rules for updating golden files if the codegen is not identical with the existing goldens.
  3. Move the existing expected class string to file-diff infra.
  4. Update developer doc to include this instruction for updating goldens.

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 9, 2020
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 location comments addressed.

// TODO(xiaozhenliu): remove this test class once the file-diff infra is in place and well-tested.
@Test
public void simpleClass() {
ClassDefinition classDef =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the composer layer in the test class, only testing classDef node. Because it's not in gapic/composer folder any more, and the GapicClass/addApacheLicense is package visible. So Apache License is manually added here to avoid reusing the helper from composer folder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM.

assertEquals(visitor.write(), EXPECTED_CLASS_STRING_WITH_HEADER);
}

private static final String APACHE_LICENSE_STRING =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to make this string as one of gapic component since it will be used in every file. @miraleung @xiaozhenliu-gg5 LMK what do you think, I could help with this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is just a temporary test, the redefinition here is fine. Other usages will leverage the constant that's defined in CommentComposer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explanation. As Mira mentioned above, we have the helper to add Apache License as one composer component. And this dummy test will be removed after file-diff infra is in place.

@summer-ji-eng
Copy link
Contributor

Overall LGTM

@xiaozhenliu-gg5 xiaozhenliu-gg5 merged commit 52c3eb7 into master Sep 10, 2020
@xiaozhenliu-gg5 xiaozhenliu-gg5 deleted the dummy_test branch September 10, 2020 21:56
suztomo pushed a commit that referenced this pull request Dec 16, 2022
[![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.api:api-common](https://togithub.com/googleapis/api-common-java) | `2.1.3` -> `2.1.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api:api-common/2.1.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api:api-common/2.1.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api:api-common/2.1.4/compatibility-slim/2.1.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api:api-common/2.1.4/confidence-slim/2.1.3)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/api-common-java</summary>

### [`v2.1.4`](https://togithub.com/googleapis/api-common-java/blob/HEAD/CHANGELOG.md#&#8203;214-httpsgithubcomgoogleapisapi-common-javacomparev213v214-2022-02-07)

</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).
suztomo pushed a commit that referenced this pull request Dec 16, 2022
πŸ€– I have created a release *beep* *boop*
---


### [1.2.3](googleapis/java-iam@v1.2.2...v1.2.3) (2022-02-08)


### Dependencies

* update dependency com.google.api:api-common to v2.1.4 ([#280](googleapis/java-iam#280)) ([e0a63a4](googleapis/java-iam@e0a63a4))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
suztomo pushed a commit that referenced this pull request Mar 21, 2023
* chore: update cloud-rad buckets

doclava v2 => staging
docFX v3 => prod

Source-Author: Emily Ball <[email protected]>
Source-Date: Tue Feb 16 17:02:08 2021 -0800
Source-Repo: googleapis/synthtool
Source-Sha: b416a7befcdbc42de41cf387dcf428f894fb812b
Source-Link: googleapis/synthtool@b416a7b

* fix: don't log downloads

@chingor13 This change keeps Maven 3.6.1 and later from spamming our CI logs with page after page of lists of artifacts it's downloading that makes it much harder to find the actual test output.

Source-Author: Elliotte Rusty Harold <[email protected]>
Source-Date: Thu Feb 18 19:58:59 2021 +0000
Source-Repo: googleapis/synthtool
Source-Sha: 1aeca92e4a38f47134cb955f52ea76f84f09ff88
Source-Link: googleapis/synthtool@1aeca92

* build: reduce download junk in log files

* fix: less download junk log files

* Update build.sh

Source-Author: Elliotte Rusty Harold <[email protected]>
Source-Date: Fri Feb 19 01:42:29 2021 +0000
Source-Repo: googleapis/synthtool
Source-Sha: 6946fd71ae9215b0e7ae188f5057df765ee6d7d2
Source-Link: googleapis/synthtool@6946fd7
suztomo pushed a commit that referenced this pull request Mar 21, 2023
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/007dd233-24d5-46ec-9c0d-21d16baa9e81/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@80003a3
Source-Link: googleapis/synthtool@538a680
Source-Link: googleapis/synthtool@019c716
Source-Link: googleapis/synthtool@968465a
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.

3 participants