(t *testing.T)
| 90 | } |
| 91 | |
| 92 | func TestBuildParallel_1(t *testing.T) { |
| 93 | // testfile has 6 builds, with first one locks 'forever', other builds |
| 94 | // should go through. |
| 95 | b := NewParallelTestBuilder(5) |
| 96 | locked := &LockedBuilder{unlock: make(chan interface{})} |
| 97 | |
| 98 | c := &BuildCommand{ |
| 99 | Meta: testMetaParallel(t, b, locked), |
| 100 | } |
| 101 | |
| 102 | args := []string{ |
| 103 | "-parallel-builds=10", |
| 104 | filepath.Join(testFixture("parallel"), "1lock-5wg.json"), |
| 105 | } |
| 106 | |
| 107 | wg := errgroup.Group{} |
| 108 | |
| 109 | wg.Go(func() error { |
| 110 | if code := c.Run(args); code != 0 { |
| 111 | fatalCommand(t, c.Meta) |
| 112 | } |
| 113 | return nil |
| 114 | }) |
| 115 | |
| 116 | b.wg.Wait() // ran 5 times |
| 117 | close(locked.unlock) // unlock locking one |
| 118 | wg.Wait() // wait for termination |
| 119 | } |
| 120 | |
| 121 | func TestBuildParallel_2(t *testing.T) { |
| 122 | // testfile has 6 builds, 2 of them lock 'forever', other builds |
nothing calls this directly
no test coverage detected
searching dependent graphs…