| 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)
|
| })
|
| }
|
|
|