(ctx context.Context, tests []TestFunc)
| 34 | } |
| 35 | |
| 36 | func testRun(ctx context.Context, tests []TestFunc) { |
| 37 | var err error |
| 38 | |
| 39 | // setup logger in context |
| 40 | testrun := time.Now().Unix() |
| 41 | |
| 42 | for i, test := range tests { |
| 43 | logger := log.Ctx(log.WithContext(ctx)).With(). |
| 44 | Int64("livetest", testrun). |
| 45 | Int("test", i+1).Logger() |
| 46 | ctx = logger.WithContext(ctx) |
| 47 | |
| 48 | err = executeTest(ctx, test, fmt.Sprintf("test-%d", i+1)) |
| 49 | if err != nil { |
| 50 | break |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | if err != nil { |
| 55 | log.Errorf("failed to run tests: %v", err) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | func executeTest(ctx context.Context, t TestFunc, name string) error { |
| 60 | // setup tracing |
searching dependent graphs…