diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2019-10-09 19:56:35 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2019-10-09 19:56:35 +0300 |
commit | f7577546b7613b5976fa0d03ed49bebfd3780b59 (patch) | |
tree | 1ed477042c45f4876a782f49952c9c3e488c888b /STYLE.md | |
parent | ca21a624582be7bcf4d43075be2a7e5981e191fa (diff) |
Use built-in RPC dummy handlers
Diffstat (limited to 'STYLE.md')
-rw-r--r-- | STYLE.md | 20 |
1 files changed, 0 insertions, 20 deletions
@@ -89,26 +89,6 @@ func TestTime(t *testing.T) { [Cheney blog post]: https://dave.cheney.net/2013/06/09/writing-table-driven-tests-in-go [Golang wiki]: https://github.com/golang/go/wiki/TableDrivenTests -## Stubs - -Stubs should be put in the file they're expected to end up in and not in `server.go`. -So for example `BlobService::GetBlob` should end up in `internal/service/blob/get_blob.go`. -This is to guard against merge conflicts, and to make it easier to find. - -To minimize diffs (and things to review in MRs) we implement the stubs as if it were -being used, even though it isn't, and should end up something like this: -``` -func (s *server) GetBlob(in *pb.GetBlobRequest, stream pb.BlobService_GetBlobServer) error { - return helper.Unimplemented -} -``` -instead of: -``` -func (server) GetBlob(_ *pb.GetBlobRequest, _ pb.BlobService_GetBlobServer) error { - return helper.Unimplemented -} -``` - ## Black box and white box testing The dominant style of testing in Gitaly is "white box" testing, meaning |