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

Unified Diff: go/src/infra/appengine/test-results/frontend/builders.go

Issue 2251613002: test-results: builders and builderstate: bug fixes, tests (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@cl-ing_upload
Patch Set: 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 | « no previous file | go/src/infra/appengine/test-results/frontend/builders_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/appengine/test-results/frontend/builders.go
diff --git a/go/src/infra/appengine/test-results/frontend/builders.go b/go/src/infra/appengine/test-results/frontend/builders.go
index d85e04fa573229c0828d28e60cf9353abd11eee8..deb44a144b8208e62ddc16bbf6bc30b3cfe917ea 100644
--- a/go/src/infra/appengine/test-results/frontend/builders.go
+++ b/go/src/infra/appengine/test-results/frontend/builders.go
@@ -29,6 +29,7 @@ type BuilderData struct {
NoUploadTestTypes []string `json:"no_upload_test_types"`
}
+// Master represents information about a build master.
type Master struct {
Name string `json:"name"`
Identifier string `json:"url_name"`
@@ -36,6 +37,7 @@ type Master struct {
Tests map[string]Test `json:"tests"`
}
+// Test represents information about Tests in a master.
type Test struct {
Builders []string `json:"builders"`
}
@@ -71,7 +73,7 @@ func makeBuildExtractClient(ctx context.Context) *buildextract.Client {
})
}
-func GetBuilders(ctx *router.Context) {
+func getBuildersHandler(ctx *router.Context) {
c, w, r := ctx.Context, ctx.Writer, ctx.Request
var res []byte
item, err := memcache.Get(c).Get(buildbotMemcacheKey)
@@ -120,7 +122,7 @@ func GetBuilders(ctx *router.Context) {
}
}
-func UpdateBuilders(ctx *router.Context) {
+func updateBuildersHandler(ctx *router.Context) {
c, w := ctx.Context, ctx.Writer
start := time.Now()
@@ -186,7 +188,7 @@ func getBuilderData(ctx context.Context, list []*masters.Master, client buildext
Name: master.Name,
Identifier: master.Identifier,
Groups: master.Groups,
- Tests: map[string]Test{},
+ Tests: make(map[string]Test),
}
go func() {
@@ -197,6 +199,10 @@ func getBuilderData(ctx context.Context, list []*masters.Master, client buildext
return
}
+ if len(builders) == 0 {
+ return
+ }
+
for _, b := range builders {
stepNames, err := getStepNames(ctx, m.Identifier, b, client)
if err != nil {
@@ -212,6 +218,7 @@ func getBuilderData(ctx context.Context, list []*masters.Master, client buildext
m.Tests[s] = t
}
}
+
results <- result{Master: m}
}()
}
@@ -326,7 +333,7 @@ func cleanTestStep(name string) (clean string, ok bool) {
}
for _, n := range nonTestStepNames {
- if strings.HasPrefix(name, n) {
+ if strings.Contains(name, n) {
return "", false
}
}
« no previous file with comments | « no previous file | go/src/infra/appengine/test-results/frontend/builders_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698