From 26b848be46f7b311151975f6c488d138f92d2558 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Thu, 16 Feb 2023 16:49:34 -0500 Subject: [PATCH] chore: Add bootstrap tests to contrib doc (#1278) --- CONTRIBUTING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b74542..aef749e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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