Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: trace/service/traceservice_test.go

Issue 1413403002: Add a Ping() method to the trace service to make it easier to detect if the service is up and runni… (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: tests Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « trace/service/traceservice.pb.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package traceservice 1 package traceservice
2 2
3 import ( 3 import (
4 "encoding/binary" 4 "encoding/binary"
5 "fmt" 5 "fmt"
6 "math" 6 "math"
7 "os" 7 "os"
8 "testing" 8 "testing"
9 "time" 9 "time"
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 "config": "gpu", 101 "config": "gpu",
102 "platform": "win8", 102 "platform": "win8",
103 "type": "skp", 103 "type": "skp",
104 }, 104 },
105 }, 105 },
106 }, 106 },
107 } 107 }
108 108
109 ctx := context.Background() 109 ctx := context.Background()
110 110
111 // First confirm that Ping() works.
112 _, err = ts.Ping(ctx, &Empty{})
113 assert.Nil(t, err)
114
111 // Confirm that these traceids don't have Params stored in the db yet. 115 // Confirm that these traceids don't have Params stored in the db yet.
112 missingRequest := &MissingParamsRequest{ 116 missingRequest := &MissingParamsRequest{
113 Traceids: []string{"key:8888:android", "key:gpu:win8"}, 117 Traceids: []string{"key:8888:android", "key:gpu:win8"},
114 } 118 }
115 missingResp, err := ts.MissingParams(ctx, missingRequest) 119 missingResp, err := ts.MissingParams(ctx, missingRequest)
116 assert.NoError(t, err) 120 assert.NoError(t, err)
117 assert.Equal(t, missingResp.Traceids, missingRequest.Traceids) 121 assert.Equal(t, missingResp.Traceids, missingRequest.Traceids)
118 122
119 // Now add the Params for them. 123 // Now add the Params for them.
120 _, err = ts.AddParams(ctx, params) 124 _, err = ts.AddParams(ctx, params)
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 229
226 b := c.ToBytes() 230 b := c.ToBytes()
227 231
228 // Test inputs that should fail. 232 // Test inputs that should fail.
229 _, err = newCommitInfo(b[1:]) 233 _, err = newCommitInfo(b[1:])
230 assert.Error(t, err) 234 assert.Error(t, err)
231 235
232 _, err = newCommitInfo(b[:len(b)-1]) 236 _, err = newCommitInfo(b[:len(b)-1])
233 assert.Error(t, err) 237 assert.Error(t, err)
234 } 238 }
OLDNEW
« no previous file with comments | « trace/service/traceservice.pb.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698