Skip to content

test: enable missing feature for test build - #2820

Open
arjan-bal wants to merge 3 commits into
grpc:masterfrom
arjan-bal:fix-test
Open

test: enable missing feature for test build#2820
arjan-bal wants to merge 3 commits into
grpc:masterfrom
arjan-bal:fix-test

Conversation

@arjan-bal

@arjan-bal arjan-bal commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Add missing feature flags to fix cargo test when run inside individual crate directories.

CI previously missed this issue because running cargo nextest from the workspace root automatically unifies workspace features.

Additionally, because the grpc-gcp example depends on protoc-gen-rust-grpc (unlike tonic examples), this PR removes grpc-gcp from the default features so cargo test works out of the box. Note that examples crate has no tests.

@arjan-bal
arjan-bal requested review from dfawley and sauravzg August 19, 2026 14:16
@arjan-bal arjan-bal added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Aug 19, 2026
@arjan-bal
arjan-bal marked this pull request as draft August 19, 2026 17:01
@arjan-bal arjan-bal assigned arjan-bal and unassigned dfawley and sauravzg Aug 19, 2026
@arjan-bal

arjan-bal commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

This may cause protoc to be built for tonic examples. I'm taking a deeper look.

Update: Fixed by removing the gRPC GCP example from the default feature set.

@arjan-bal
arjan-bal marked this pull request as ready for review August 20, 2026 11:23
@arjan-bal arjan-bal assigned dfawley and unassigned arjan-bal Aug 20, 2026

@dfawley dfawley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I still don't understand cargo well enough, it seems....

Comment thread examples/Cargo.toml
@@ -294,7 +294,7 @@ grpc-helloworld = ["dep:grpc", "dep:grpc-protobuf", "dep:protobuf"]
full = ["gcp", "routeguide", "reflection", "autoreload", "health", "grpc-web",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it OK that full doesn't include a feature? I guess it's also missing "tower" and "h2" already?

But what's the point in having "full" anyway? Should we delete it and move the things to "default" so it isn't misleading?

Comment thread examples/README.md
ready, you can run the example like so:
```bash
$ cargo run --bin grpc-gcp-client -- <project-id>
$ cargo run --bin grpc-gcp-client --features grpc-gcp -- <project-id>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is still a required feature for the binary in the cargo.toml though? Does that actually mean you have to set it manually or else it won't run?

@dfawley dfawley assigned arjan-bal and unassigned dfawley Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants