Skip to content

Commit 41253eb

Browse files
committed
fix(rollup,tests): simplify multiple_rollups_same_pr so that the goal is to verify the acceptable case of multiple rollups may point to the same member PR
1 parent f523abf commit 41253eb

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/github/rollup.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,8 @@ mod tests {
620620
");
621621
}
622622

623-
/// Ensure that a PR can be associated to multiple rollups in case of CI failure in the initial rollup
623+
/// Ensure that a PR can be associated to multiple rollups.
624+
/// This can happen when opening a new rollup similar to an existing one, before closing the old one.
624625
#[sqlx::test]
625626
async fn multiple_rollups_same_pr(pool: sqlx::PgPool) {
626627
let gh = run_test((pool, rollup_state()), async |ctx: &mut BorsTester| {
@@ -630,16 +631,19 @@ mod tests {
630631
ctx.approve(pr3.id()).await?;
631632

632633
make_rollup(ctx, &[&pr2, &pr3]).await?;
633-
// Simulate a maintainer closing the rollup due to a CI failure requiring popping a PR from the contents
634-
ctx.set_pr_status_closed(4).await?;
635634
make_rollup(ctx, &[&pr3]).await?;
636-
// Ensure both rollups have the requested PRs
637635
assert_eq!(
638636
ctx.db().get_nonclosed_rollups(&pr2.repo).await?,
639-
HashMap::from([(
640-
PullRequestNumber(5),
641-
HashSet::from_iter(vec![PullRequestNumber(3)])
642-
)])
637+
HashMap::from([
638+
(
639+
PullRequestNumber(4),
640+
HashSet::from_iter(vec![PullRequestNumber(2), PullRequestNumber(3)])
641+
),
642+
(
643+
PullRequestNumber(5),
644+
HashSet::from_iter(vec![PullRequestNumber(3)])
645+
)
646+
])
643647
);
644648
Ok(())
645649
})

0 commit comments

Comments
 (0)