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

Side by Side Diff: appengine/tsmon/standardmetrics_test.go

Issue 1854583002: Migrate tsmon protos to proto3 (Closed) Base URL: git@github.com:luci/luci-go.git@master
Patch Set: Created 4 years, 8 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 | « appengine/tsmon/middleware_test.go ('k') | common/tsmon/context.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package tsmon 5 package tsmon
6 6
7 import ( 7 import (
8 "testing" 8 "testing"
9 9
10 "github.com/golang/protobuf/proto"
11 "github.com/luci/luci-go/common/tsmon" 10 "github.com/luci/luci-go/common/tsmon"
12 "github.com/luci/luci-go/common/tsmon/monitor" 11 "github.com/luci/luci-go/common/tsmon/monitor"
13 "github.com/luci/luci-go/common/tsmon/store" 12 "github.com/luci/luci-go/common/tsmon/store"
14 "github.com/luci/luci-go/common/tsmon/target" 13 "github.com/luci/luci-go/common/tsmon/target"
15 14
16 . "github.com/smartystreets/goconvey/convey" 15 . "github.com/smartystreets/goconvey/convey"
17 ) 16 )
18 17
19 func TestStandardMetrics(t *testing.T) { 18 func TestStandardMetrics(t *testing.T) {
20 Convey("Default version", t, func() { 19 Convey("Default version", t, func() {
21 c, _ := buildGAETestContext() 20 c, _ := buildGAETestContext()
22 » » tsmon.GetState(c).S = store.NewInMemory(&target.Task{ServiceName : proto.String("default target")}) 21 » » tsmon.GetState(c).S = store.NewInMemory(&target.Task{ServiceName : "default target"})
23 standardMetricsCallback(c) 22 standardMetricsCallback(c)
24 tsmon.Flush(c) 23 tsmon.Flush(c)
25 24
26 monitor := tsmon.GetState(c).M.(*monitor.Fake) 25 monitor := tsmon.GetState(c).M.(*monitor.Fake)
27 So(len(monitor.Cells), ShouldEqual, 1) 26 So(len(monitor.Cells), ShouldEqual, 1)
28 So(monitor.Cells[0][0].Name, ShouldEqual, "appengine/default_ver sion") 27 So(monitor.Cells[0][0].Name, ShouldEqual, "appengine/default_ver sion")
29 So(monitor.Cells[0][0].Value, ShouldEqual, "testVersion1") 28 So(monitor.Cells[0][0].Value, ShouldEqual, "testVersion1")
30 }) 29 })
31 } 30 }
OLDNEW
« no previous file with comments | « appengine/tsmon/middleware_test.go ('k') | common/tsmon/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698