Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

fix: use separate value generator in test generation #3294

Merged
merged 2 commits into from
Oct 13, 2020

Conversation

yihanzhen
Copy link
Contributor

@yihanzhen yihanzhen commented Oct 13, 2020

Sometimes a library has two requests methods with a field of the same name but different types. The TestValueGenerator keys on the short name of fields, and reuses a generated value if it has generated a value for this key (short field name). Therefore in such cases it may try to assign a string literal to a integer type.

Change to create a different TestValueGenerator for every single test case generation to avoid such cases.

@yihanzhen yihanzhen requested a review from a team as a code owner October 13, 2020 00:36
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 13, 2020
@codecov
Copy link

codecov bot commented Oct 13, 2020

Codecov Report

Merging #3294 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3294   +/-   ##
=========================================
  Coverage     87.14%   87.14%           
  Complexity     6105     6105           
=========================================
  Files           495      495           
  Lines         24146    24146           
  Branches       2628     2628           
=========================================
  Hits          21041    21041           
  Misses         2242     2242           
  Partials        863      863           
Impacted Files Coverage Δ Complexity Δ
...e/api/codegen/transformer/TestCaseTransformer.java 98.59% <100.00%> (ø) 54.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3162638...e3db2bf. Read the comment docs.

Copy link
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Hanzhen for fixing the stuff you are not longer responsible for =)

@yihanzhen yihanzhen merged commit 9f97d83 into googleapis:master Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants