Skip to content

Commit

Permalink
chore: Add bootstrap tests to contrib doc (hyperium#1278)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucioFranco authored Feb 16, 2023
1 parent 773e4e1 commit 26b848b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 26b848b

Please sign in to comment.