| 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 "flag" | 8 "flag" |
| 9 "fmt" | 9 "fmt" |
| 10 "io/ioutil" | 10 "io/ioutil" |
| 11 "net/http" | 11 "net/http" |
| 12 "net/url" | 12 "net/url" |
| 13 "path/filepath" | 13 "path/filepath" |
| 14 "regexp" | 14 "regexp" |
| 15 "strings" | 15 "strings" |
| 16 "testing" | 16 "testing" |
| 17 "time" | 17 "time" |
| 18 | 18 |
| 19 "golang.org/x/net/context" | 19 "golang.org/x/net/context" |
| 20 | 20 |
| 21 "github.com/luci/gae/impl/memory" | 21 "github.com/luci/gae/impl/memory" |
| 22 "github.com/luci/luci-go/common/clock/testclock" | 22 "github.com/luci/luci-go/common/clock/testclock" |
| 23 "github.com/luci/luci-go/milo/appengine/buildbot" | |
| 24 "github.com/luci/luci-go/milo/appengine/common" | 23 "github.com/luci/luci-go/milo/appengine/common" |
| 25 "github.com/luci/luci-go/milo/appengine/swarming" | 24 "github.com/luci/luci-go/milo/appengine/swarming" |
| 26 "github.com/luci/luci-go/server/auth" | 25 "github.com/luci/luci-go/server/auth" |
| 27 "github.com/luci/luci-go/server/auth/authtest" | 26 "github.com/luci/luci-go/server/auth/authtest" |
| 28 "github.com/luci/luci-go/server/auth/identity" | 27 "github.com/luci/luci-go/server/auth/identity" |
| 29 "github.com/luci/luci-go/server/settings" | 28 "github.com/luci/luci-go/server/settings" |
| 30 "github.com/luci/luci-go/server/templates" | 29 "github.com/luci/luci-go/server/templates" |
| 31 | 30 |
| 32 . "github.com/smartystreets/goconvey/convey" | 31 . "github.com/smartystreets/goconvey/convey" |
| 33 ) | 32 ) |
| 34 | 33 |
| 35 type testPackage struct { | 34 type testPackage struct { |
| 36 Data func() []common.TestBundle | 35 Data func() []common.TestBundle |
| 37 DisplayName string | 36 DisplayName string |
| 38 TemplateName string | 37 TemplateName string |
| 39 } | 38 } |
| 40 | 39 |
| 41 var ( | 40 var ( |
| 42 allPackages = []testPackage{ | 41 allPackages = []testPackage{ |
| 43 » » {buildbot.BuildTestData, "buildbot.build", "build.html"}, | 42 » » {buildbotBuildTestData, "buildbot.build", "build.html"}, |
| 44 » » {buildbot.BuilderTestData, "buildbot.builder", "builder.html"}, | 43 » » {buildbotBuilderTestData, "buildbot.builder", "builder.html"}, |
| 45 {swarming.BuildTestData, "swarming.build", "build.html"}, | 44 {swarming.BuildTestData, "swarming.build", "build.html"}, |
| 46 {swarming.LogTestData, "swarming.log", "log.html"}, | 45 {swarming.LogTestData, "swarming.log", "log.html"}, |
| 47 {frontpageTestData, "frontpage", "frontpage.html"}, | 46 {frontpageTestData, "frontpage", "frontpage.html"}, |
| 48 } | 47 } |
| 49 ) | 48 ) |
| 50 | 49 |
| 51 var generate = flag.Bool( | 50 var generate = flag.Bool( |
| 52 "test.generate", false, "Generate expectations instead of running tests.
") | 51 "test.generate", false, "Generate expectations instead of running tests.
") |
| 53 | 52 |
| 54 func expectFileName(name string) string { | 53 func expectFileName(name string) string { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 localBuf, err := load(fn
ame) | 110 localBuf, err := load(fn
ame) |
| 112 So(err, ShouldBeNil) | 111 So(err, ShouldBeNil) |
| 113 So(fixZeroDuration(strin
g(buf)), ShouldEqual, fixZeroDuration(string(localBuf))) | 112 So(fixZeroDuration(strin
g(buf)), ShouldEqual, fixZeroDuration(string(localBuf))) |
| 114 } | 113 } |
| 115 }) | 114 }) |
| 116 } | 115 } |
| 117 }) | 116 }) |
| 118 } | 117 } |
| 119 }) | 118 }) |
| 120 } | 119 } |
| OLD | NEW |