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

Unified Diff: milo/appengine/frontend/buildbot_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
Index: milo/appengine/frontend/buildbot_data.go
diff --git a/milo/appengine/buildbot/html_data.go b/milo/appengine/frontend/buildbot_data.go
similarity index 73%
copy from milo/appengine/buildbot/html_data.go
copy to milo/appengine/frontend/buildbot_data.go
index 6640bc81a2447c814aa912a87bdac7fc27476c63..0006fcf2ea7a165449928e3e6f8ec3ba58a4c1ea 100644
--- a/milo/appengine/buildbot/html_data.go
+++ b/milo/appengine/frontend/buildbot_data.go
@@ -2,7 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
-package buildbot
+package frontend
import (
"fmt"
@@ -10,35 +10,26 @@ import (
"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/buildbot"
"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
-}{
- {"CrWinGoma", 30608},
- {"win_chromium_rel_ng", 246309},
- {"newline", 1234},
-}
-
-// BuildTestData returns sample test data for build pages.
-func BuildTestData() []common.TestBundle {
+// buildbotBuildTestData returns sample test data for build pages.
+func buildbotBuildTestData() []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)
+ for _, tc := range buildbot.TestCases {
+ build, err := buildbot.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))
+ tc.Builder, tc.Build, err))
}
bundles = append(bundles, common.TestBundle{
- Description: fmt.Sprintf("Debug page: %s/%d", tc.builder, tc.build),
+ Description: fmt.Sprintf("Debug page: %s/%d", tc.Builder, tc.Build),
Data: templates.Args{
"Build": build,
},
@@ -47,8 +38,8 @@ func BuildTestData() []common.TestBundle {
return bundles
}
-// BiulderTestData returns sample test data for builder pages.
-func BuilderTestData() []common.TestBundle {
+// buildbotBuilderTestData returns sample test data for builder pages.
+func buildbotBuilderTestData() []common.TestBundle {
return []common.TestBundle{
{
Description: "Basic Test no builds",

Powered by Google App Engine
This is Rietveld 408576698