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

Unified Diff: milo/appengine/buildbot/html_data.go

Issue 2856273004: Milo: Increase test coverage for appengine/buildbot (Closed)
Patch Set: review Created 3 years, 7 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 | « milo/appengine/buildbot/html.go ('k') | milo/appengine/buildbot/html_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbot/html_data.go
diff --git a/milo/appengine/buildbot/html_data.go b/milo/appengine/buildbot/html_data.go
index 6640bc81a2447c814aa912a87bdac7fc27476c63..98a373d641cb89917d4d5fc1cc0e2045c8b15909 100644
--- a/milo/appengine/buildbot/html_data.go
+++ b/milo/appengine/buildbot/html_data.go
@@ -1,97 +1,12 @@
-// Copyright 2016 The LUCI Authors. All rights reserved.
-// Use of this source code is governed under the Apache License, Version 2.0
-// that can be found in the LICENSE file.
-
package buildbot
-import (
- "fmt"
-
- "github.com/luci/gae/impl/memory"
- "github.com/luci/luci-go/common/clock/testclock"
- "github.com/luci/luci-go/milo/api/resp"
- "github.com/luci/luci-go/milo/appengine/common"
- "github.com/luci/luci-go/server/templates"
- "golang.org/x/net/context"
-)
-
// We put this here because _test.go files are sometimes not built.
-var testCases = []struct {
- builder string
- build int
+var TestCases = []struct {
+ Builder string
+ Build int
}{
{"CrWinGoma", 30608},
- {"win_chromium_rel_ng", 246309},
+ {"chromium_presubmit", 426944},
{"newline", 1234},
-}
-
-// BuildTestData returns sample test data for build pages.
-func BuildTestData() []common.TestBundle {
- c := memory.Use(context.Background())
- c, _ = testclock.UseTime(c, testclock.TestTimeUTC)
- bundles := []common.TestBundle{}
- for _, tc := range testCases {
- build, err := build(c, "debug", tc.builder, tc.build)
- if err != nil {
- panic(fmt.Errorf(
- "Encountered error while building debug/%s/%s.\n%s",
- tc.builder, tc.build, err))
- }
- bundles = append(bundles, common.TestBundle{
- Description: fmt.Sprintf("Debug page: %s/%d", tc.builder, tc.build),
- Data: templates.Args{
- "Build": build,
- },
- })
- }
- return bundles
-}
-
-// BiulderTestData returns sample test data for builder pages.
-func BuilderTestData() []common.TestBundle {
- return []common.TestBundle{
- {
- Description: "Basic Test no builds",
- Data: templates.Args{
- "Builder": &resp.Builder{
- Name: "Sample Builder",
- },
- },
- },
- {
- Description: "Basic Test with builds",
- Data: templates.Args{
- "Builder": &resp.Builder{
- Name: "Sample Builder",
- CurrentBuilds: []*resp.BuildSummary{
- {
- Link: &resp.Link{
- URL: "https://some.url/path",
- Label: "Some current build",
- },
- Revision: "deadbeef",
- },
- },
- PendingBuilds: []*resp.BuildSummary{
- {
- Link: &resp.Link{
- URL: "https://some.url/path",
- Label: "Some current build",
- },
- Revision: "deadbeef",
- },
- },
- FinishedBuilds: []*resp.BuildSummary{
- {
- Link: &resp.Link{
- URL: "https://some.url/path",
- Label: "Some current build",
- },
- Revision: "deadbeef",
- },
- },
- },
- },
- },
- }
+ {"win_chromium_rel_ng", 246309},
}
« no previous file with comments | « milo/appengine/buildbot/html.go ('k') | milo/appengine/buildbot/html_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698