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

Unified Diff: go/src/infra/appengine/test-results/model/test_file.go

Issue 2234353002: test-results: package model: Add full_result.go and tests (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Improve coverage Created 4 years, 4 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 | « go/src/infra/appengine/test-results/model/model.infra_testing ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/appengine/test-results/model/test_file.go
diff --git a/go/src/infra/appengine/test-results/model/test_file.go b/go/src/infra/appengine/test-results/model/test_file.go
index dbaf84fda924c6ec41de35fb2b2aa7192c11d7c5..e86ecce19046220a12204b58cf7160a0c0ae5119 100644
--- a/go/src/infra/appengine/test-results/model/test_file.go
+++ b/go/src/infra/appengine/test-results/model/test_file.go
@@ -26,13 +26,16 @@ func IsAggregateTestFile(filename string) bool {
}
// BuildNum is int64 that is used to handle TestFile datastore records
-// with null build_number.
+// with null build_number. The value is >= 0 if the datastore value
+// was not null.
type BuildNum int64
var _ datastore.PropertyConverter = (*BuildNum)(nil)
+// IsNil returns whether b had null value in datastore.
func (b *BuildNum) IsNil() bool { return *b == -1 }
+// ToProperty is for implementing datastore.PropertyConverter.
func (b *BuildNum) ToProperty() (p datastore.Property, err error) {
if b.IsNil() {
return
@@ -41,6 +44,7 @@ func (b *BuildNum) ToProperty() (p datastore.Property, err error) {
return
}
+// FromProperty is for implementing datastore.PropertyConverter.
func (b *BuildNum) FromProperty(p datastore.Property) error {
switch p.Type() {
case datastore.PTNull:
« no previous file with comments | « go/src/infra/appengine/test-results/model/model.infra_testing ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698