Antoine Musso | 45dd2cb | 2014-01-29 17:17:43 +0100 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | # Copyright 2012 Hewlett-Packard Development Company, L.P. |
| 4 | # Copyright 2014 Wikimedia Foundation Inc. |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 7 | # not use this file except in compliance with the License. You may obtain |
| 8 | # a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 15 | # License for the specific language governing permissions and limitations |
| 16 | # under the License. |
| 17 | |
| 18 | import logging |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 19 | import time |
Antoine Musso | 45dd2cb | 2014-01-29 17:17:43 +0100 | [diff] [blame] | 20 | |
James E. Blair | d8af542 | 2017-05-24 13:59:40 -0700 | [diff] [blame] | 21 | from tests.base import ZuulTestCase, simple_layout |
Antoine Musso | 45dd2cb | 2014-01-29 17:17:43 +0100 | [diff] [blame] | 22 | |
Antoine Musso | 45dd2cb | 2014-01-29 17:17:43 +0100 | [diff] [blame] | 23 | |
James E. Blair | b3b5b38 | 2017-06-02 11:29:57 -0700 | [diff] [blame] | 24 | class TestExecutorRepos(ZuulTestCase): |
James E. Blair | d8af542 | 2017-05-24 13:59:40 -0700 | [diff] [blame] | 25 | tenant_config_file = 'config/single-tenant/main.yaml' |
Antoine Musso | 45dd2cb | 2014-01-29 17:17:43 +0100 | [diff] [blame] | 26 | |
James E. Blair | b3b5b38 | 2017-06-02 11:29:57 -0700 | [diff] [blame] | 27 | log = logging.getLogger("zuul.test.executor") |
Antoine Musso | 45dd2cb | 2014-01-29 17:17:43 +0100 | [diff] [blame] | 28 | |
James E. Blair | af3d01e | 2017-05-26 14:30:18 -0700 | [diff] [blame] | 29 | def assertRepoState(self, repo, state, project, build, number): |
James E. Blair | bcaa2d4 | 2017-05-26 15:44:23 -0700 | [diff] [blame] | 30 | if 'branch' in state: |
| 31 | self.assertFalse(repo.head.is_detached, |
| 32 | 'Project %s commit for build %s #%s should ' |
| 33 | 'not have a detached HEAD' % ( |
| 34 | project, build, number)) |
| 35 | self.assertEquals(repo.active_branch.name, |
| 36 | state['branch'], |
| 37 | 'Project %s commit for build %s #%s should ' |
| 38 | 'be on the correct branch' % ( |
| 39 | project, build, number)) |
| 40 | if 'commit' in state: |
| 41 | self.assertEquals(state['commit'], |
James E. Blair | af3d01e | 2017-05-26 14:30:18 -0700 | [diff] [blame] | 42 | str(repo.commit('HEAD')), |
| 43 | 'Project %s commit for build %s #%s should ' |
| 44 | 'be correct' % ( |
| 45 | project, build, number)) |
James E. Blair | bcaa2d4 | 2017-05-26 15:44:23 -0700 | [diff] [blame] | 46 | ref = repo.commit('HEAD') |
| 47 | repo_messages = set( |
| 48 | [c.message.strip() for c in repo.iter_commits(ref)]) |
| 49 | if 'present' in state: |
| 50 | for change in state['present']: |
James E. Blair | af3d01e | 2017-05-26 14:30:18 -0700 | [diff] [blame] | 51 | msg = '%s-1' % change.subject |
| 52 | self.assertTrue(msg in repo_messages, |
| 53 | 'Project %s for build %s #%s should ' |
| 54 | 'have change %s' % ( |
| 55 | project, build, number, change.subject)) |
James E. Blair | bcaa2d4 | 2017-05-26 15:44:23 -0700 | [diff] [blame] | 56 | if 'absent' in state: |
| 57 | for change in state['absent']: |
James E. Blair | af3d01e | 2017-05-26 14:30:18 -0700 | [diff] [blame] | 58 | msg = '%s-1' % change.subject |
| 59 | self.assertTrue(msg not in repo_messages, |
| 60 | 'Project %s for build %s #%s should ' |
| 61 | 'not have change %s' % ( |
| 62 | project, build, number, change.subject)) |
| 63 | |
James E. Blair | 987855f | 2017-06-06 14:41:58 -0700 | [diff] [blame] | 64 | def assertBuildStates(self, states, projects): |
| 65 | for number, build in enumerate(self.builds): |
| 66 | work = build.getWorkspaceRepos(projects) |
| 67 | state = states[number] |
| 68 | |
| 69 | for project in projects: |
| 70 | self.assertRepoState(work[project], state[project], |
| 71 | project, build, number) |
| 72 | |
| 73 | self.executor_server.hold_jobs_in_build = False |
| 74 | self.executor_server.release() |
| 75 | self.waitUntilSettled() |
| 76 | |
James E. Blair | d8af542 | 2017-05-24 13:59:40 -0700 | [diff] [blame] | 77 | @simple_layout('layouts/repo-checkout-two-project.yaml') |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 78 | def test_one_branch(self): |
James E. Blair | d8af542 | 2017-05-24 13:59:40 -0700 | [diff] [blame] | 79 | self.executor_server.hold_jobs_in_build = True |
Antoine Musso | 45dd2cb | 2014-01-29 17:17:43 +0100 | [diff] [blame] | 80 | |
James E. Blair | d8af542 | 2017-05-24 13:59:40 -0700 | [diff] [blame] | 81 | p1 = 'review.example.com/org/project1' |
| 82 | p2 = 'review.example.com/org/project2' |
| 83 | projects = [p1, p2] |
Antoine Musso | 45dd2cb | 2014-01-29 17:17:43 +0100 | [diff] [blame] | 84 | A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A') |
| 85 | B = self.fake_gerrit.addFakeChange('org/project2', 'master', 'B') |
James E. Blair | d8af542 | 2017-05-24 13:59:40 -0700 | [diff] [blame] | 86 | A.addApproval('code-review', 2) |
| 87 | B.addApproval('code-review', 2) |
| 88 | self.fake_gerrit.addEvent(A.addApproval('approved', 1)) |
| 89 | self.fake_gerrit.addEvent(B.addApproval('approved', 1)) |
Antoine Musso | 45dd2cb | 2014-01-29 17:17:43 +0100 | [diff] [blame] | 90 | |
| 91 | self.waitUntilSettled() |
| 92 | |
| 93 | self.assertEquals(2, len(self.builds), "Two builds are running") |
| 94 | |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 95 | upstream = self.getUpstreamRepos(projects) |
| 96 | states = [ |
James E. Blair | bcaa2d4 | 2017-05-26 15:44:23 -0700 | [diff] [blame] | 97 | {p1: dict(present=[A], absent=[B], branch='master'), |
| 98 | p2: dict(commit=str(upstream[p2].commit('master')), |
| 99 | branch='master'), |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 100 | }, |
James E. Blair | bcaa2d4 | 2017-05-26 15:44:23 -0700 | [diff] [blame] | 101 | {p1: dict(present=[A], absent=[B], branch='master'), |
| 102 | p2: dict(present=[B], absent=[A], branch='master'), |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 103 | }, |
Joshua Hesketh | 29d99b7 | 2014-08-19 16:27:42 +1000 | [diff] [blame] | 104 | ] |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 105 | |
James E. Blair | 987855f | 2017-06-06 14:41:58 -0700 | [diff] [blame] | 106 | self.assertBuildStates(states, projects) |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 107 | |
James E. Blair | af3d01e | 2017-05-26 14:30:18 -0700 | [diff] [blame] | 108 | @simple_layout('layouts/repo-checkout-four-project.yaml') |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 109 | def test_multi_branch(self): |
James E. Blair | af3d01e | 2017-05-26 14:30:18 -0700 | [diff] [blame] | 110 | self.executor_server.hold_jobs_in_build = True |
| 111 | |
| 112 | p1 = 'review.example.com/org/project1' |
| 113 | p2 = 'review.example.com/org/project2' |
| 114 | p3 = 'review.example.com/org/project3' |
| 115 | p4 = 'review.example.com/org/project4' |
| 116 | projects = [p1, p2, p3, p4] |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 117 | |
| 118 | self.create_branch('org/project2', 'stable/havana') |
| 119 | self.create_branch('org/project4', 'stable/havana') |
| 120 | A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A') |
Joshua Hesketh | 29d99b7 | 2014-08-19 16:27:42 +1000 | [diff] [blame] | 121 | B = self.fake_gerrit.addFakeChange('org/project2', 'stable/havana', |
| 122 | 'B') |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 123 | C = self.fake_gerrit.addFakeChange('org/project3', 'master', 'C') |
James E. Blair | af3d01e | 2017-05-26 14:30:18 -0700 | [diff] [blame] | 124 | A.addApproval('code-review', 2) |
| 125 | B.addApproval('code-review', 2) |
| 126 | C.addApproval('code-review', 2) |
| 127 | self.fake_gerrit.addEvent(A.addApproval('approved', 1)) |
| 128 | self.fake_gerrit.addEvent(B.addApproval('approved', 1)) |
| 129 | self.fake_gerrit.addEvent(C.addApproval('approved', 1)) |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 130 | |
| 131 | self.waitUntilSettled() |
| 132 | |
| 133 | self.assertEquals(3, len(self.builds), "Three builds are running") |
| 134 | |
| 135 | upstream = self.getUpstreamRepos(projects) |
| 136 | states = [ |
James E. Blair | bcaa2d4 | 2017-05-26 15:44:23 -0700 | [diff] [blame] | 137 | {p1: dict(present=[A], absent=[B, C], branch='master'), |
| 138 | p2: dict(commit=str(upstream[p2].commit('master')), |
| 139 | branch='master'), |
| 140 | p3: dict(commit=str(upstream[p3].commit('master')), |
| 141 | branch='master'), |
| 142 | p4: dict(commit=str(upstream[p4].commit('master')), |
| 143 | branch='master'), |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 144 | }, |
James E. Blair | bcaa2d4 | 2017-05-26 15:44:23 -0700 | [diff] [blame] | 145 | {p1: dict(present=[A], absent=[B, C], branch='master'), |
| 146 | p2: dict(present=[B], absent=[A, C], branch='stable/havana'), |
| 147 | p3: dict(commit=str(upstream[p3].commit('master')), |
| 148 | branch='master'), |
| 149 | p4: dict(commit=str(upstream[p4].commit('stable/havana')), |
| 150 | branch='stable/havana'), |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 151 | }, |
James E. Blair | bcaa2d4 | 2017-05-26 15:44:23 -0700 | [diff] [blame] | 152 | {p1: dict(present=[A], absent=[B, C], branch='master'), |
| 153 | p2: dict(commit=str(upstream[p2].commit('master')), |
| 154 | branch='master'), |
| 155 | p3: dict(present=[C], absent=[A, B], branch='master'), |
| 156 | p4: dict(commit=str(upstream[p4].commit('master')), |
| 157 | branch='master'), |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 158 | }, |
Joshua Hesketh | 29d99b7 | 2014-08-19 16:27:42 +1000 | [diff] [blame] | 159 | ] |
James E. Blair | 97d902e | 2014-08-21 13:25:56 -0700 | [diff] [blame] | 160 | |
James E. Blair | 987855f | 2017-06-06 14:41:58 -0700 | [diff] [blame] | 161 | self.assertBuildStates(states, projects) |
James E. Blair | bce35e1 | 2014-08-21 14:31:17 -0700 | [diff] [blame] | 162 | |
James E. Blair | 4de8d9e | 2017-06-01 15:41:40 -0700 | [diff] [blame] | 163 | @simple_layout('layouts/repo-checkout-six-project.yaml') |
James E. Blair | f042022 | 2014-08-21 16:02:17 -0700 | [diff] [blame] | 164 | def test_project_override(self): |
James E. Blair | 4de8d9e | 2017-06-01 15:41:40 -0700 | [diff] [blame] | 165 | self.executor_server.hold_jobs_in_build = True |
| 166 | |
| 167 | p1 = 'review.example.com/org/project1' |
| 168 | p2 = 'review.example.com/org/project2' |
| 169 | p3 = 'review.example.com/org/project3' |
| 170 | p4 = 'review.example.com/org/project4' |
| 171 | p5 = 'review.example.com/org/project5' |
| 172 | p6 = 'review.example.com/org/project6' |
| 173 | projects = [p1, p2, p3, p4, p5, p6] |
James E. Blair | f042022 | 2014-08-21 16:02:17 -0700 | [diff] [blame] | 174 | |
| 175 | self.create_branch('org/project3', 'stable/havana') |
| 176 | self.create_branch('org/project4', 'stable/havana') |
| 177 | self.create_branch('org/project6', 'stable/havana') |
| 178 | A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A') |
| 179 | B = self.fake_gerrit.addFakeChange('org/project1', 'master', 'B') |
| 180 | C = self.fake_gerrit.addFakeChange('org/project2', 'master', 'C') |
Joshua Hesketh | 29d99b7 | 2014-08-19 16:27:42 +1000 | [diff] [blame] | 181 | D = self.fake_gerrit.addFakeChange('org/project3', 'stable/havana', |
| 182 | 'D') |
James E. Blair | 4de8d9e | 2017-06-01 15:41:40 -0700 | [diff] [blame] | 183 | A.addApproval('code-review', 2) |
| 184 | B.addApproval('code-review', 2) |
| 185 | C.addApproval('code-review', 2) |
| 186 | D.addApproval('code-review', 2) |
| 187 | self.fake_gerrit.addEvent(A.addApproval('approved', 1)) |
| 188 | self.fake_gerrit.addEvent(B.addApproval('approved', 1)) |
| 189 | self.fake_gerrit.addEvent(C.addApproval('approved', 1)) |
| 190 | self.fake_gerrit.addEvent(D.addApproval('approved', 1)) |
James E. Blair | f042022 | 2014-08-21 16:02:17 -0700 | [diff] [blame] | 191 | |
| 192 | self.waitUntilSettled() |
| 193 | |
| 194 | self.assertEquals(4, len(self.builds), "Four builds are running") |
| 195 | |
| 196 | upstream = self.getUpstreamRepos(projects) |
| 197 | states = [ |
James E. Blair | 4de8d9e | 2017-06-01 15:41:40 -0700 | [diff] [blame] | 198 | {p1: dict(present=[A], absent=[B, C, D], branch='master'), |
| 199 | p2: dict(commit=str(upstream[p2].commit('master')), |
| 200 | branch='master'), |
| 201 | p3: dict(commit=str(upstream[p3].commit('master')), |
| 202 | branch='master'), |
| 203 | p4: dict(commit=str(upstream[p4].commit('master')), |
| 204 | branch='master'), |
| 205 | p5: dict(commit=str(upstream[p5].commit('master')), |
| 206 | branch='master'), |
| 207 | p6: dict(commit=str(upstream[p6].commit('master')), |
| 208 | branch='master'), |
James E. Blair | f042022 | 2014-08-21 16:02:17 -0700 | [diff] [blame] | 209 | }, |
James E. Blair | 4de8d9e | 2017-06-01 15:41:40 -0700 | [diff] [blame] | 210 | {p1: dict(present=[A, B], absent=[C, D], branch='master'), |
| 211 | p2: dict(commit=str(upstream[p2].commit('master')), |
| 212 | branch='master'), |
| 213 | p3: dict(commit=str(upstream[p3].commit('master')), |
| 214 | branch='master'), |
| 215 | p4: dict(commit=str(upstream[p4].commit('master')), |
| 216 | branch='master'), |
| 217 | p5: dict(commit=str(upstream[p5].commit('master')), |
| 218 | branch='master'), |
| 219 | p6: dict(commit=str(upstream[p6].commit('master')), |
| 220 | branch='master'), |
James E. Blair | f042022 | 2014-08-21 16:02:17 -0700 | [diff] [blame] | 221 | }, |
James E. Blair | 4de8d9e | 2017-06-01 15:41:40 -0700 | [diff] [blame] | 222 | {p1: dict(present=[A, B], absent=[C, D], branch='master'), |
| 223 | p2: dict(present=[C], absent=[A, B, D], branch='master'), |
| 224 | p3: dict(commit=str(upstream[p3].commit('master')), |
| 225 | branch='master'), |
| 226 | p4: dict(commit=str(upstream[p4].commit('master')), |
| 227 | branch='master'), |
| 228 | p5: dict(commit=str(upstream[p5].commit('master')), |
| 229 | branch='master'), |
| 230 | p6: dict(commit=str(upstream[p6].commit('master')), |
| 231 | branch='master'), |
James E. Blair | f042022 | 2014-08-21 16:02:17 -0700 | [diff] [blame] | 232 | }, |
James E. Blair | 4de8d9e | 2017-06-01 15:41:40 -0700 | [diff] [blame] | 233 | {p1: dict(present=[A, B], absent=[C, D], branch='master'), |
| 234 | p2: dict(present=[C], absent=[A, B, D], branch='master'), |
| 235 | p3: dict(present=[D], absent=[A, B, C], |
| 236 | branch='stable/havana'), |
| 237 | p4: dict(commit=str(upstream[p4].commit('master')), |
| 238 | branch='master'), |
| 239 | p5: dict(commit=str(upstream[p5].commit('master')), |
| 240 | branch='master'), |
| 241 | p6: dict(commit=str(upstream[p6].commit('stable/havana')), |
| 242 | branch='stable/havana'), |
James E. Blair | f042022 | 2014-08-21 16:02:17 -0700 | [diff] [blame] | 243 | }, |
Joshua Hesketh | 29d99b7 | 2014-08-19 16:27:42 +1000 | [diff] [blame] | 244 | ] |
James E. Blair | f042022 | 2014-08-21 16:02:17 -0700 | [diff] [blame] | 245 | |
James E. Blair | 987855f | 2017-06-06 14:41:58 -0700 | [diff] [blame] | 246 | self.assertBuildStates(states, projects) |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 247 | |
| 248 | def test_periodic(self): |
James E. Blair | 95ae4fc | 2017-06-01 15:54:53 -0700 | [diff] [blame] | 249 | # This test can not use simple_layout because it must start |
| 250 | # with a configuration which does not include a |
| 251 | # timer-triggered job so that we have an opportunity to set |
| 252 | # the hold flag before the first job. |
| 253 | self.executor_server.hold_jobs_in_build = True |
| 254 | # Start timer trigger - also org/project |
| 255 | self.commitConfigUpdate('common-config', |
| 256 | 'layouts/repo-checkout-timer.yaml') |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 257 | self.sched.reconfigure(self.config) |
James E. Blair | 95ae4fc | 2017-06-01 15:54:53 -0700 | [diff] [blame] | 258 | |
| 259 | p1 = 'review.example.com/org/project1' |
| 260 | projects = [p1] |
| 261 | self.create_branch('org/project1', 'stable/havana') |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 262 | |
| 263 | # The pipeline triggers every second, so we should have seen |
| 264 | # several by now. |
| 265 | time.sleep(5) |
| 266 | self.waitUntilSettled() |
| 267 | |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 268 | # Stop queuing timer triggered jobs so that the assertions |
| 269 | # below don't race against more jobs being queued. |
James E. Blair | 95ae4fc | 2017-06-01 15:54:53 -0700 | [diff] [blame] | 270 | self.commitConfigUpdate('common-config', |
| 271 | 'layouts/repo-checkout-no-timer.yaml') |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 272 | self.sched.reconfigure(self.config) |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 273 | |
James E. Blair | 95ae4fc | 2017-06-01 15:54:53 -0700 | [diff] [blame] | 274 | self.assertEquals(1, len(self.builds), "One build is running") |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 275 | |
| 276 | upstream = self.getUpstreamRepos(projects) |
| 277 | states = [ |
James E. Blair | 95ae4fc | 2017-06-01 15:54:53 -0700 | [diff] [blame] | 278 | {p1: dict(commit=str(upstream[p1].commit('stable/havana')), |
| 279 | branch='stable/havana'), |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 280 | }, |
Joshua Hesketh | 29d99b7 | 2014-08-19 16:27:42 +1000 | [diff] [blame] | 281 | ] |
James E. Blair | 217b10d | 2015-01-08 16:25:28 -0800 | [diff] [blame] | 282 | |
James E. Blair | 987855f | 2017-06-06 14:41:58 -0700 | [diff] [blame] | 283 | self.assertBuildStates(states, projects) |
Sachi King | 9f16d52 | 2016-03-16 12:20:45 +1100 | [diff] [blame] | 284 | |
James E. Blair | bbe811e | 2017-06-02 10:47:44 -0700 | [diff] [blame] | 285 | @simple_layout('layouts/repo-checkout-post.yaml') |
Sachi King | 9f16d52 | 2016-03-16 12:20:45 +1100 | [diff] [blame] | 286 | def test_post_and_master_checkout(self): |
James E. Blair | 1de2e49 | 2017-06-02 11:04:42 -0700 | [diff] [blame] | 287 | self.executor_server.hold_jobs_in_build = True |
| 288 | p1 = "review.example.com/org/project1" |
| 289 | p2 = "review.example.com/org/project2" |
| 290 | projects = [p1, p2] |
James E. Blair | 8cce42e | 2016-10-18 08:18:36 -0700 | [diff] [blame] | 291 | |
James E. Blair | 1de2e49 | 2017-06-02 11:04:42 -0700 | [diff] [blame] | 292 | A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A') |
James E. Blair | 8cce42e | 2016-10-18 08:18:36 -0700 | [diff] [blame] | 293 | event = A.getRefUpdatedEvent() |
| 294 | A.setMerged() |
| 295 | self.fake_gerrit.addEvent(event) |
| 296 | self.waitUntilSettled() |
| 297 | |
James E. Blair | 8cce42e | 2016-10-18 08:18:36 -0700 | [diff] [blame] | 298 | upstream = self.getUpstreamRepos(projects) |
James E. Blair | 1de2e49 | 2017-06-02 11:04:42 -0700 | [diff] [blame] | 299 | states = [ |
| 300 | {p1: dict(commit=str(upstream[p1].commit('master')), |
| 301 | present=[A], branch='master'), |
| 302 | p2: dict(commit=str(upstream[p2].commit('master')), |
| 303 | absent=[A], branch='master'), |
| 304 | }, |
| 305 | ] |
James E. Blair | 8cce42e | 2016-10-18 08:18:36 -0700 | [diff] [blame] | 306 | |
James E. Blair | 987855f | 2017-06-06 14:41:58 -0700 | [diff] [blame] | 307 | self.assertBuildStates(states, projects) |