Skip to content

test(parser/protobuf): use NewTest* in tests - #7759

Merged
coryan merged 2 commits into
googleapis:mainfrom
coryan:newtest-pr14-protobuf-parser
Oct 6, 2026
Merged

coryan merged 2 commits into
googleapis:mainfrom
coryan:newtest-pr14-protobuf-parser

Conversation

@coryan

@coryan coryan commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Towards #7722

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors various unit tests in the parser package to use fluent test builders (such as NewTestField, NewTestMessage, and NewTestService) instead of raw struct literals, significantly improving test readability. The review feedback points out that several manual field-clearing operations (such as setting f.Parent = nil or createMethod.Service = nil) are redundant because the test helpers apitest.CheckMessage and apitest.CheckService already ignore these fields during comparison.

Comment thread internal/sidekick/parser/protobuf_test.go
Comment thread internal/sidekick/parser/protobuf_test.go
@coryan
coryan marked this pull request as ready for review October 6, 2026 12:15
@coryan
coryan requested review from a team as code owners October 6, 2026 12:15
@coryan
coryan merged commit 293b599 into googleapis:main Oct 6, 2026
47 of 48 checks passed
@coryan
coryan deleted the newtest-pr14-protobuf-parser branch October 6, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants