March 2021
Intermediate to advanced
260 pages
5h 45m
English
Now that we’ve finished our gRPC server, we need some tests to check that our client and server work like we expect. We’ve already tested the details of our log’s library implementation in the library, so the tests we’re writing here are at a higher level and focus on ensuring that everything’s hooked up properly between the gRPC and library bits and that our gRPC client and server can communicate.
In the grpc directory, create a server_test.go file, and add the following code that will set up your test:
| | package server |
| | |
| | import ( |
| | "context" |
| | "io/ioutil" |
| | "net" |
| | "testing" |
| | |
| | "github.com/stretchr/testify/require" |
| | api "github.com/travisjeffery/proglog/api/v1" ... |
Read now
Unlock full access