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

fix: correctly recognize oneofs and include them in the testing #469

Merged
merged 2 commits into from
Jun 17, 2020

Conversation

viacheslav-rostovtsev
Copy link
Member

the way the method_helper looked for oneof fields was to compare the oneof_index of the field descriptors; however oneof_index for the non-oneof fields is 0, the same as an index for the first oneof field.
This PR rectifies the issue. As a result, the tests for the methods that have an input with one of more oneof fields now correctly include all the non-oneof fields and the first field from each oneof group.

This PR also reverts the GetTypicalGarbage method to use TypicalGarbage as it's input so that the tests are generated for the gamut of the values that TypicalGarbage contains, including maps (and now oneof).
This method was changed to use a different input and as a result we were not generating any tests that include TypicalGarbage's fields.

The GetTypicalGarbage method that uses TypicalGarbageRequest is now a separate method called GetTypicalGarbageByRequest

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 17, 2020
@viacheslav-rostovtsev viacheslav-rostovtsev changed the title feat: correctly recognize oneofs and include them in the testing fix: correctly recognize oneofs and include them in the testing Jun 17, 2020
Copy link
Member

@dazuma dazuma 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 an extra feature request.

@viacheslav-rostovtsev viacheslav-rostovtsev merged commit 9905bf3 into master Jun 17, 2020
@viacheslav-rostovtsev viacheslav-rostovtsev deleted the dev/virost/fix/oneof_fix branch June 17, 2020 20:08
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