MCPcopy Create free account
hub / github.com/pace/bricks / testRun

Function testRun

test/livetest/livetest.go:36–57  ·  view source on GitHub ↗
(ctx context.Context, tests []TestFunc)

Source from the content-addressed store, hash-verified

34}
35
36func 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
59func executeTest(ctx context.Context, t TestFunc, name string) error {
60 // setup tracing

Callers 1

TestFunction · 0.85

Calls 6

CtxFunction · 0.92
WithContextFunction · 0.92
ErrorfFunction · 0.92
executeTestFunction · 0.85
NowMethod · 0.80
WithContextMethod · 0.80

Tested by 1

TestFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…