statsFakeBackend implements Backend for CollectStats tests. It is separate from the generations_test.go fakeBackend because those tests stub different methods and we want independent control. Methods not exercised here return errors so any misuse surfaces loudly.
| 15 | // stub different methods and we want independent control. Methods not |
| 16 | // exercised here return errors so any misuse surfaces loudly. |
| 17 | type statsFakeBackend struct { |
| 18 | active *Generation |
| 19 | activeErr error |
| 20 | building *Generation |
| 21 | buildErr error |
| 22 | statsByGen map[GenerationID]Stats |
| 23 | statsErr map[GenerationID]error |
| 24 | } |
| 25 | |
| 26 | func (f *statsFakeBackend) ActiveGeneration(context.Context) (Generation, error) { |
| 27 | if f.activeErr != nil { |
nothing calls this directly
no outgoing calls
no test coverage detected