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

Unified Diff: milo/appengine/buildbot/build_test.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/build.go ('k') | milo/appengine/buildbot/builder.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbot/build_test.go
diff --git a/milo/appengine/buildbot/build_test.go b/milo/appengine/buildbot/build_test.go
index a0d9d8f52c2bbc1f14910833787d5a02b91bcb15..1eca5c0d0225c7b163881fe9f57293bcc3dc3dd9 100644
--- a/milo/appengine/buildbot/build_test.go
+++ b/milo/appengine/buildbot/build_test.go
@@ -49,17 +49,17 @@ func TestBuild(t *testing.T) {
c, _ = testclock.UseTime(c, testclock.TestTimeUTC)
if *generate {
- for _, tc := range testCases {
- fmt.Printf("Generating expectations for %s/%s\n", tc.builder, tc.build)
- build, err := build(c, "debug", tc.builder, tc.build)
+ for _, tc := range TestCases {
+ fmt.Printf("Generating expectations for %s/%s\n", tc.Builder, tc.Build)
+ build, err := Build(c, "debug", tc.Builder, tc.Build)
if err != nil {
- panic(fmt.Errorf("Could not run build() for %s/%s: %s", tc.builder, tc.build, err))
+ panic(fmt.Errorf("Could not run build() for %s/%s: %s", tc.Builder, tc.Build, err))
}
buildJSON, err := json.MarshalIndent(build, "", " ")
if err != nil {
- panic(fmt.Errorf("Could not JSON marshal %s/%s: %s", tc.builder, tc.build, err))
+ panic(fmt.Errorf("Could not JSON marshal %s/%s: %s", tc.Builder, tc.Build, err))
}
- fname := fmt.Sprintf("%s.%d.build.json", tc.builder, tc.build)
+ fname := fmt.Sprintf("%s.%d.build.json", tc.Builder, tc.Build)
fpath := path.Join("expectations", fname)
err = ioutil.WriteFile(fpath, []byte(buildJSON), 0644)
if err != nil {
@@ -76,11 +76,11 @@ func TestBuild(t *testing.T) {
IdentityGroups: []string{"all"},
})
- for _, tc := range testCases {
- Convey(fmt.Sprintf("Test Case: %s/%s", tc.builder, tc.build), func() {
- build, err := build(c, "debug", tc.builder, tc.build)
+ for _, tc := range TestCases {
+ Convey(fmt.Sprintf("Test Case: %s/%s", tc.Builder, tc.Build), func() {
+ build, err := Build(c, "debug", tc.Builder, tc.Build)
So(err, ShouldBeNil)
- fname := fmt.Sprintf("%s.%d.build.json", tc.builder, tc.build)
+ fname := fmt.Sprintf("%s.%d.build.json", tc.Builder, tc.Build)
So(build, shouldMatchExpectationsFor, fname)
})
}
« no previous file with comments | « milo/appengine/buildbot/build.go ('k') | milo/appengine/buildbot/builder.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698