chore: Add bootstrap tests to contrib doc (#1278)

This commit is contained in:
Lucio Franco
2023-02-16 16:49:34 -05:00
committed by GitHub
parent 773e4e1749
commit 26b848be46
+18
View File
@@ -206,6 +206,24 @@ example would explicitly use `Timeout::new`. For example:
/// # }
```
#### Generated code
When making changes to `tonic-build` that affects the generated code you will
need to ensure that each of the sub crates gets updated as well. Each of the sub
crates like, for example `tonic-health`, generate their gRPC code via a
`bootstrap.rs` test.
The bootstrap tests work by generating the code and then checking git if there
is any uncommitted generated code (there is a difference between the proto files
and the committed generated code). At this point the test will fail telling you
to commit the new code. When the new code is committed, running the test suite
again will cause it to pass as the generated code doesn't create a diff for git
and thus its up to date.
```
cargo test --all
```
### Commits
It is a recommended best practice to keep your changes as logically grouped as