Run core engine tests +cache="session"
( ctx context.Context, // Only run these tests // +optional run string, // Skip these tests // +optional skip string, // +optional // +default="./..." pkg string, // Abort test run on first failure // +optional failfast bool, // How many tests to run in parallel - defaults to the number of CPUs // +optional parallel int, // How long before timing out the test run // +optional timeout string, // +optional race bool, // +default=1 // +optional count int, // +optional envFile *dagger.Secret, // Enable verbose output // +optional testVerbose bool, // Update golden files // +optional update bool, // Enable the given ebpf progs in the engine during tests // +optional ebpfProgs []string, )
| 20 | // Run core engine tests |
| 21 | // +cache="session" |
| 22 | func (dev *EngineDev) Test( |
| 23 | ctx context.Context, |
| 24 | // Only run these tests |
| 25 | // +optional |
| 26 | run string, |
| 27 | // Skip these tests |
| 28 | // +optional |
| 29 | skip string, |
| 30 | // +optional |
| 31 | // +default="./..." |
| 32 | pkg string, |
| 33 | // Abort test run on first failure |
| 34 | // +optional |
| 35 | failfast bool, |
| 36 | // How many tests to run in parallel - defaults to the number of CPUs |
| 37 | // +optional |
| 38 | parallel int, |
| 39 | // How long before timing out the test run |
| 40 | // +optional |
| 41 | timeout string, |
| 42 | // +optional |
| 43 | race bool, |
| 44 | // +default=1 |
| 45 | // +optional |
| 46 | count int, |
| 47 | // +optional |
| 48 | envFile *dagger.Secret, |
| 49 | // Enable verbose output |
| 50 | // +optional |
| 51 | testVerbose bool, |
| 52 | // Update golden files |
| 53 | // +optional |
| 54 | update bool, |
| 55 | // Enable the given ebpf progs in the engine during tests |
| 56 | // +optional |
| 57 | ebpfProgs []string, |
| 58 | ) error { |
| 59 | // FIXME: use the damn standard Go toolchain |
| 60 | ctr, _, err := dev.testContainer(ctx, ebpfProgs) |
| 61 | if err != nil { |
| 62 | return err |
| 63 | } |
| 64 | _, err = dev.test(ctx, ctr, &testOpts{ |
| 65 | runTestRegex: run, |
| 66 | skipTestRegex: skip, |
| 67 | pkg: pkg, |
| 68 | failfast: failfast, |
| 69 | parallel: parallel, |
| 70 | timeout: timeout, |
| 71 | race: race, |
| 72 | count: count, |
| 73 | envs: envFile, |
| 74 | testVerbose: testVerbose, |
| 75 | update: update, |
| 76 | }, |
| 77 | ).Sync(ctx) |
| 78 | return err |
| 79 | } |
no test coverage detected