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 frontend | 5 package frontend |
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/buildbot" | |
14 "github.com/luci/luci-go/milo/appengine/common" | 13 "github.com/luci/luci-go/milo/appengine/common" |
| 14 "github.com/luci/luci-go/milo/appengine/job_source/buildbot" |
15 "github.com/luci/luci-go/server/templates" | 15 "github.com/luci/luci-go/server/templates" |
16 "golang.org/x/net/context" | 16 "golang.org/x/net/context" |
17 ) | 17 ) |
18 | 18 |
19 // buildbotBuildTestData returns sample test data for build pages. | 19 // buildbotBuildTestData returns sample test data for build pages. |
20 func buildbotBuildTestData() []common.TestBundle { | 20 func buildbotBuildTestData() []common.TestBundle { |
21 c := memory.Use(context.Background()) | 21 c := memory.Use(context.Background()) |
22 c, _ = testclock.UseTime(c, testclock.TestTimeUTC) | 22 c, _ = testclock.UseTime(c, testclock.TestTimeUTC) |
23 bundles := []common.TestBundle{} | 23 bundles := []common.TestBundle{} |
24 for _, tc := range buildbot.TestCases { | 24 for _, tc := range buildbot.TestCases { |
25 » » build, err := buildbot.Build(c, "debug", tc.Builder, tc.Build) | 25 » » build, err := buildbot.DebugBuild(c, "../job_source/buildbot", t
c.Builder, tc.Build) |
26 if err != nil { | 26 if err != nil { |
27 panic(fmt.Errorf( | 27 panic(fmt.Errorf( |
28 "Encountered error while building debug/%s/%s.\n
%s", | 28 "Encountered error while building debug/%s/%s.\n
%s", |
29 tc.Builder, tc.Build, err)) | 29 tc.Builder, tc.Build, err)) |
30 } | 30 } |
31 bundles = append(bundles, common.TestBundle{ | 31 bundles = append(bundles, common.TestBundle{ |
32 Description: fmt.Sprintf("Debug page: %s/%d", tc.Builder
, tc.Build), | 32 Description: fmt.Sprintf("Debug page: %s/%d", tc.Builder
, tc.Build), |
33 Data: templates.Args{ | 33 Data: templates.Args{ |
34 "Build": build, | 34 "Build": build, |
35 }, | 35 }, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 {Link: l, Revision: "deadbeef"}, | 68 {Link: l, Revision: "deadbeef"}, |
69 }, | 69 }, |
70 FinishedBuilds: []*resp.BuildSummary{ | 70 FinishedBuilds: []*resp.BuildSummary{ |
71 {Link: l, Revision: "deadbeef"}, | 71 {Link: l, Revision: "deadbeef"}, |
72 }, | 72 }, |
73 }, | 73 }, |
74 }, | 74 }, |
75 }, | 75 }, |
76 } | 76 } |
77 } | 77 } |
OLD | NEW |