Skip to content

Commit

Permalink
grpc: test: make testing REST interface a subtest
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammed90 committed Aug 21, 2019
1 parent 657a709 commit 1d8a205
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions grpc/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,7 @@ func TestServer(t *testing.T) {

ctx, cancel := context.WithCancel(context.Background())
go Server(ctx, app)
defer func() {
cancel()

time.Sleep(time.Second * 2)
}()
defer cancel()

// to use with REST API
jar, err := cookiejar.New(nil)
Expand Down Expand Up @@ -615,9 +611,10 @@ func TestServer(t *testing.T) {
assert.NotEmpty(t, res)
})
})
t.Run("testRESTInterface", testRESTInterface)
}

func TestRESTInterface(t *testing.T) {
func testRESTInterface(t *testing.T) {
// Default logger
logger := logrus.New()
logger.Formatter = &logrus.JSONFormatter{}
Expand Down

0 comments on commit 1d8a205

Please sign in to comment.