assertTaskRunsCollide verifies that after both projects have rolled out, their task_run ids collide. Call this from tests that run project B's rollout and depend on task_run collisions. Note: nextProjectID allocates per table, so task_run collision does not imply plan_check_run collision. Each tabl
(ctx context.Context, t *testing.T, ctl *controller, f *collisionFixture)
| 353 | // Note: nextProjectID allocates per table, so task_run collision does not |
| 354 | // imply plan_check_run collision. Each table needs its own assertion. |
| 355 | func assertTaskRunsCollide(ctx context.Context, t *testing.T, ctl *controller, f *collisionFixture) { |
| 356 | t.Helper() |
| 357 | a := require.New(t) |
| 358 | |
| 359 | aTaskRuns, _ := listTaskRunAndTaskUIDs(ctx, t, ctl, f.PlanA.Name) |
| 360 | bTaskRuns, _ := listTaskRunAndTaskUIDs(ctx, t, ctl, f.PlanB.Name) |
| 361 | a.Greater(len(aTaskRuns), 0, "project A should have at least one task_run") |
| 362 | a.Greater(len(bTaskRuns), 0, "project B should have at least one task_run — did you forget to roll out B?") |
| 363 | assertAtLeastOneUIDCollides(t, aTaskRuns, bTaskRuns, "task_run") |
| 364 | } |
| 365 | |
| 366 | // assertTasksCollide verifies that task UIDs collide across projects. |
| 367 | // Task UIDs are embedded in task_run resource names, so we can derive |
no test coverage detected