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

Function Test

test/livetest/livetest.go:20–34  ·  view source on GitHub ↗

Test executes the passed tests in the given order (array order). The tests are executed in the configured interval until the given context is done.

(ctx context.Context, tests []TestFunc)

Source from the content-addressed store, hash-verified

18// The tests are executed in the configured interval until the given
19// context is done.
20func Test(ctx context.Context, tests []TestFunc) error {
21 t := time.NewTicker(cfg.Interval)
22
23 // run test at least once
24 testRun(ctx, tests)
25
26 for {
27 select {
28 case <-ctx.Done():
29 return ctx.Err()
30 case <-t.C:
31 testRun(ctx, tests)
32 }
33 }
34}
35
36func testRun(ctx context.Context, tests []TestFunc) {
37 var err error

Callers 3

mainFunction · 0.92
ExampleTestFunction · 0.92
TestIntegrationExampleFunction · 0.70

Calls 2

testRunFunction · 0.85
ErrMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…