-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore(internal/librariangen): remove the legacy protoc/gRPC plugins #13372
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -206,7 +206,7 @@ go_grpc_library( | |||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| func TestParse_legacyProtocPlugin_noGrpc(t *testing.T) { | ||||||||||||||||||||||||
| func TestParse_goProtoLibrary_noGrpc(t *testing.T) { | ||||||||||||||||||||||||
| content := ` | ||||||||||||||||||||||||
| go_proto_library( | ||||||||||||||||||||||||
| name = "asset_go_proto", | ||||||||||||||||||||||||
|
|
@@ -242,9 +242,6 @@ go_gapic_library( | |||||||||||||||||||||||
| if got.HasGoGRPC() { | ||||||||||||||||||||||||
| t.Error("HasGoGRPC() = true; want false") | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| if got.HasLegacyGRPC() { | ||||||||||||||||||||||||
| t.Error("HasLegacyGRPC() = true; want false") | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| func TestParse_legacyProtocPlugin_withGrpc(t *testing.T) { | ||||||||||||||||||||||||
|
|
@@ -275,17 +272,9 @@ go_gapic_library( | |||||||||||||||||||||||
| t.Fatalf("failed to write test file: %v", err) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| got, err := Parse(tmpDir) | ||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||
| t.Fatalf("Parse() failed: %v", err) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Only test the bits related to protoc plugins | ||||||||||||||||||||||||
| if got.HasGoGRPC() { | ||||||||||||||||||||||||
| t.Error("HasGoGRPC() = true; want false") | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| if !got.HasLegacyGRPC() { | ||||||||||||||||||||||||
| t.Error("HasLegacyGRPC() = false; want true") | ||||||||||||||||||||||||
| _, err := Parse(tmpDir) | ||||||||||||||||||||||||
| if err == nil { | ||||||||||||||||||||||||
| t.Error("Parse() succeeded; want error") | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+275
to
278
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To make this test more robust, it's a good practice to assert not just that an error occurred, but that the correct error occurred. You can check if the error message contains a specific substring related to the legacy plugin. Also, consider using
Suggested change
|
||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -302,6 +291,6 @@ func TestDisableGAPIC(t *testing.T) { | |||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| cfg.DisableGAPIC() | ||||||||||||||||||||||||
| if cfg.HasGAPIC() { | ||||||||||||||||||||||||
| t.Error("HasLegacyGRPC() = true; want false") | ||||||||||||||||||||||||
| t.Error("HasGAPIC() = true; want false") | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message
requires legacy gRPC plugincould be misinterpreted as a missing dependency. To improve clarity for users who encounter this error, consider rephrasing it to state that the legacy plugin is no longer supported.