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

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

Issue 1857643003: Revert of 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"
10 "github.com/luci/luci-go/common/tsmon" 11 "github.com/luci/luci-go/common/tsmon"
11 "github.com/luci/luci-go/common/tsmon/monitor" 12 "github.com/luci/luci-go/common/tsmon/monitor"
12 "github.com/luci/luci-go/common/tsmon/store" 13 "github.com/luci/luci-go/common/tsmon/store"
13 "github.com/luci/luci-go/common/tsmon/target" 14 "github.com/luci/luci-go/common/tsmon/target"
14 15
15 . "github.com/smartystreets/goconvey/convey" 16 . "github.com/smartystreets/goconvey/convey"
16 ) 17 )
17 18
18 func TestStandardMetrics(t *testing.T) { 19 func TestStandardMetrics(t *testing.T) {
19 Convey("Default version", t, func() { 20 Convey("Default version", t, func() {
20 c, _ := buildGAETestContext() 21 c, _ := buildGAETestContext()
21 » » tsmon.GetState(c).S = store.NewInMemory(&target.Task{ServiceName : "default target"}) 22 » » tsmon.GetState(c).S = store.NewInMemory(&target.Task{ServiceName : proto.String("default target")})
22 standardMetricsCallback(c) 23 standardMetricsCallback(c)
23 tsmon.Flush(c) 24 tsmon.Flush(c)
24 25
25 monitor := tsmon.GetState(c).M.(*monitor.Fake) 26 monitor := tsmon.GetState(c).M.(*monitor.Fake)
26 So(len(monitor.Cells), ShouldEqual, 1) 27 So(len(monitor.Cells), ShouldEqual, 1)
27 So(monitor.Cells[0][0].Name, ShouldEqual, "appengine/default_ver sion") 28 So(monitor.Cells[0][0].Name, ShouldEqual, "appengine/default_ver sion")
28 So(monitor.Cells[0][0].Value, ShouldEqual, "testVersion1") 29 So(monitor.Cells[0][0].Value, ShouldEqual, "testVersion1")
29 }) 30 })
30 } 31 }
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