| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 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 swarming | 5 package swarming |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "encoding/json" | 8 "encoding/json" |
| 9 "fmt" | 9 "fmt" |
| 10 "io/ioutil" | 10 "io/ioutil" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 c = memory.UseWithAppID(c, "dev~luci-milo") | 256 c = memory.UseWithAppID(c, "dev~luci-milo") |
| 257 c = testconfig.WithCommonClient(c, memcfg.New(aclConfgs)) | 257 c = testconfig.WithCommonClient(c, memcfg.New(aclConfgs)) |
| 258 c = auth.WithState(c, &authtest.FakeState{ | 258 c = auth.WithState(c, &authtest.FakeState{ |
| 259 Identity: "user:alicebob@google.com", | 259 Identity: "user:alicebob@google.com", |
| 260 IdentityGroups: []string{"all", "googlers"}, | 260 IdentityGroups: []string{"all", "googlers"}, |
| 261 }) | 261 }) |
| 262 c, _ = testclock.UseTime(c, time.Date(2016, time.March, 14, 11, 0, 0, 0,
time.UTC)) | 262 c, _ = testclock.UseTime(c, time.Date(2016, time.March, 14, 11, 0, 0, 0,
time.UTC)) |
| 263 | 263 |
| 264 for _, tc := range getTestCases(swarmingRelDir) { | 264 for _, tc := range getTestCases(swarmingRelDir) { |
| 265 svc := debugSwarmingService{tc} | 265 svc := debugSwarmingService{tc} |
| 266 » » bl := buildLoader{ | 266 » » bl := BuildLoader{ |
| 267 logDogClientFunc: logDogClientFunc(tc), | 267 logDogClientFunc: logDogClientFunc(tc), |
| 268 } | 268 } |
| 269 | 269 |
| 270 » » build, err := bl.swarmingBuildImpl(c, svc, "foo", tc.name) | 270 » » build, err := bl.SwarmingBuildImpl(c, svc, "foo", tc.name) |
| 271 if err != nil { | 271 if err != nil { |
| 272 panic(fmt.Errorf("Error while processing %s: %s", tc.nam
e, err)) | 272 panic(fmt.Errorf("Error while processing %s: %s", tc.nam
e, err)) |
| 273 } | 273 } |
| 274 results = append(results, common.TestBundle{ | 274 results = append(results, common.TestBundle{ |
| 275 Description: tc.name, | 275 Description: tc.name, |
| 276 Data: templates.Args{"Build": build}, | 276 Data: templates.Args{"Build": build}, |
| 277 }) | 277 }) |
| 278 } | 278 } |
| 279 return results | 279 return results |
| 280 } | 280 } |
| 281 | 281 |
| 282 var secretProjectCfg = ` | 282 var secretProjectCfg = ` |
| 283 name: "secret" | 283 name: "secret" |
| 284 access: "group:googlers" | 284 access: "group:googlers" |
| 285 ` | 285 ` |
| 286 | 286 |
| 287 var publicProjectCfg = ` | 287 var publicProjectCfg = ` |
| 288 name: "opensource" | 288 name: "opensource" |
| 289 access: "group:all" | 289 access: "group:all" |
| 290 ` | 290 ` |
| 291 | 291 |
| 292 var aclConfgs = map[string]memcfg.ConfigSet{ | 292 var aclConfgs = map[string]memcfg.ConfigSet{ |
| 293 "projects/secret": { | 293 "projects/secret": { |
| 294 "project.cfg": secretProjectCfg, | 294 "project.cfg": secretProjectCfg, |
| 295 }, | 295 }, |
| 296 "projects/opensource": { | 296 "projects/opensource": { |
| 297 "project.cfg": publicProjectCfg, | 297 "project.cfg": publicProjectCfg, |
| 298 }, | 298 }, |
| 299 } | 299 } |
| OLD | NEW |