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

Unified Diff: common/tsmon/store/testing.go

Issue 1854583002: Migrate tsmon protos to proto3 (Closed) Base URL: git@github.com:luci/luci-go.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/tsmon/store/inmemory_test.go ('k') | common/tsmon/target/target.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/tsmon/store/testing.go
diff --git a/common/tsmon/store/testing.go b/common/tsmon/store/testing.go
index a7a7ceef77f64ea8d28e6db6aada01e6d40c4bf8..c449b62fa16af3b2c3f65971bc0ab45b8fe9bcab 100644
--- a/common/tsmon/store/testing.go
+++ b/common/tsmon/store/testing.go
@@ -262,7 +262,7 @@ func RunStoreImplementationTests(t *testing.T, ctx context.Context, opts TestOpt
So(len(all), ShouldEqual, 1)
msg := monitor.SerializeCell(all[0])
- So(time.Unix(0, int64(msg.GetStartTimestampUs()*uint64(time.Microsecond))).UTC().String(),
+ So(time.Unix(0, int64(msg.StartTimestampUs*uint64(time.Microsecond))).UTC().String(),
ShouldEqual, t.String())
})
}
@@ -288,7 +288,7 @@ func RunStoreImplementationTests(t *testing.T, ctx context.Context, opts TestOpt
// Create a context with a different target.
t := target.Task{}
- t.AsProto().ServiceName = proto.String("foo")
+ t.AsProto().ServiceName = "foo"
ctxWithTarget := target.Set(ctx, &t)
// Set the first value on the default target, second value on the
@@ -319,9 +319,9 @@ func RunStoreImplementationTests(t *testing.T, ctx context.Context, opts TestOpt
coll := monitor.SerializeCells(all)
sort.Sort(sortableDataSlice(coll.Data))
- So(coll.Data[0].Task.GetServiceName(), ShouldEqual,
- s.DefaultTarget().(*target.Task).AsProto().GetServiceName())
- So(coll.Data[1].Task.GetServiceName(), ShouldEqual, t.AsProto().GetServiceName())
+ So(coll.Data[0].Task.ServiceName, ShouldEqual,
+ s.DefaultTarget().(*target.Task).AsProto().ServiceName)
+ So(coll.Data[1].Task.ServiceName, ShouldEqual, t.AsProto().ServiceName)
})
}
})
@@ -466,7 +466,7 @@ func RunStoreImplementationTests(t *testing.T, ctx context.Context, opts TestOpt
So(len(all), ShouldEqual, 1)
msg := monitor.SerializeCell(all[0])
- So(time.Unix(0, int64(msg.GetStartTimestampUs()*uint64(time.Microsecond))).UTC().String(),
+ So(time.Unix(0, int64(msg.StartTimestampUs*uint64(time.Microsecond))).UTC().String(),
ShouldEqual, t.String())
})
}
@@ -492,7 +492,7 @@ func RunStoreImplementationTests(t *testing.T, ctx context.Context, opts TestOpt
// Create a context with a different target.
t := target.Task{}
- t.AsProto().ServiceName = proto.String("foo")
+ t.AsProto().ServiceName = "foo"
ctxWithTarget := target.Set(ctx, &t)
// Incr the first delta on the default target, second delta on the
@@ -513,9 +513,9 @@ func RunStoreImplementationTests(t *testing.T, ctx context.Context, opts TestOpt
coll := monitor.SerializeCells(all)
sort.Sort(sortableDataSlice(coll.Data))
- So(coll.Data[0].Task.GetServiceName(), ShouldEqual,
- s.DefaultTarget().(*target.Task).AsProto().GetServiceName())
- So(coll.Data[1].Task.GetServiceName(), ShouldEqual, t.AsProto().GetServiceName())
+ So(coll.Data[0].Task.ServiceName, ShouldEqual,
+ s.DefaultTarget().(*target.Task).AsProto().ServiceName)
+ So(coll.Data[1].Task.ServiceName, ShouldEqual, t.AsProto().ServiceName)
})
}
})
@@ -661,7 +661,7 @@ func RunStoreImplementationTests(t *testing.T, ctx context.Context, opts TestOpt
opts.RegistrationFinished(s)
t := target.Task{}
- t.AsProto().ServiceName = proto.String("foo")
+ t.AsProto().ServiceName = "foo"
ctxWithTarget := target.Set(ctx, &t)
So(s.Set(ctx, m, time.Time{}, []interface{}{}, int64(42)), ShouldBeNil)
« no previous file with comments | « common/tsmon/store/inmemory_test.go ('k') | common/tsmon/target/target.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698