| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package buildbot | 5 package buildbot |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 | 9 |
| 10 "github.com/luci/gae/impl/memory" | 10 "github.com/luci/gae/impl/memory" |
| 11 "github.com/luci/luci-go/common/clock/testclock" | 11 "github.com/luci/luci-go/common/clock/testclock" |
| 12 "github.com/luci/luci-go/milo/api/resp" | 12 "github.com/luci/luci-go/milo/api/resp" |
| 13 "github.com/luci/luci-go/milo/appengine/common" | 13 "github.com/luci/luci-go/milo/appengine/common" |
| 14 "github.com/luci/luci-go/server/templates" | 14 "github.com/luci/luci-go/server/templates" |
| 15 "golang.org/x/net/context" | 15 "golang.org/x/net/context" |
| 16 ) | 16 ) |
| 17 | 17 |
| 18 // We put this here because _test.go files are sometimes not built. | 18 // We put this here because _test.go files are sometimes not built. |
| 19 var testCases = []struct { | 19 var testCases = []struct { |
| 20 builder string | 20 builder string |
| 21 build int | 21 build int |
| 22 }{ | 22 }{ |
| 23 {"CrWinGoma", 30608}, | 23 {"CrWinGoma", 30608}, |
| 24 {"win_chromium_rel_ng", 246309}, | 24 {"win_chromium_rel_ng", 246309}, |
| 25 {"newline", 1234}, |
| 25 } | 26 } |
| 26 | 27 |
| 27 // BuildTestData returns sample test data for build pages. | 28 // BuildTestData returns sample test data for build pages. |
| 28 func BuildTestData() []common.TestBundle { | 29 func BuildTestData() []common.TestBundle { |
| 29 c := memory.Use(context.Background()) | 30 c := memory.Use(context.Background()) |
| 30 c, _ = testclock.UseTime(c, testclock.TestTimeUTC) | 31 c, _ = testclock.UseTime(c, testclock.TestTimeUTC) |
| 31 bundles := []common.TestBundle{} | 32 bundles := []common.TestBundle{} |
| 32 for _, tc := range testCases { | 33 for _, tc := range testCases { |
| 33 build, err := build(c, "debug", tc.builder, tc.build) | 34 build, err := build(c, "debug", tc.builder, tc.build) |
| 34 if err != nil { | 35 if err != nil { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 Label: "Some cur
rent build", | 88 Label: "Some cur
rent build", |
| 88 }, | 89 }, |
| 89 Revision: "deadbeef", | 90 Revision: "deadbeef", |
| 90 }, | 91 }, |
| 91 }, | 92 }, |
| 92 }, | 93 }, |
| 93 }, | 94 }, |
| 94 }, | 95 }, |
| 95 } | 96 } |
| 96 } | 97 } |
| OLD | NEW |