assertFixtureIDsCollide verifies that the "colliding IDs" invariant the whole harness depends on is actually true. If a future change adds an extra project-scoped allocation on either path, the tests would silently stop exercising the composite-PK collision case; this assertion fails fast in that ca
(ctx context.Context, t *testing.T, ctl *controller, f *collisionFixture)
| 292 | // belt-and-suspenders for the task_run claim test, not an |
| 293 | // independent regression lock. |
| 294 | func assertFixtureIDsCollide(ctx context.Context, t *testing.T, ctl *controller, f *collisionFixture) { |
| 295 | t.Helper() |
| 296 | a := require.New(t) |
| 297 | |
| 298 | aPlans := listPlanUIDs(ctx, t, ctl, f.ProjectA.Name) |
| 299 | bPlans := listPlanUIDs(ctx, t, ctl, f.ProjectB.Name) |
| 300 | a.Greater(len(aPlans), 0, "project A should have at least one plan") |
| 301 | a.Greater(len(bPlans), 0, "project B should have at least one plan") |
| 302 | assertAtLeastOneUIDCollides(t, aPlans, bPlans, "plan") |
| 303 | |
| 304 | aIssues := listIssueUIDs(ctx, t, ctl, f.ProjectA.Name) |
| 305 | bIssues := listIssueUIDs(ctx, t, ctl, f.ProjectB.Name) |
| 306 | a.Greater(len(aIssues), 0, "project A should have at least one issue") |
| 307 | a.Greater(len(bIssues), 0, "project B should have at least one issue") |
| 308 | assertAtLeastOneUIDCollides(t, aIssues, bIssues, "issue") |
| 309 | } |
| 310 | |
| 311 | // completeRolloutB drives project B's rollout to completion and proves that |
| 312 | // task and task_run ids collide across the two projects. This is the ONLY |
no test coverage detected