Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/bors/handlers/autobuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async fn notify_of_invalid_retry_state(
mod tests {
use crate::tests::{BorsTester, Comment, GitHub, User, run_test};

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn retry_command_insufficient_privileges(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment(Comment::from("@bors retry").with_author(User::unprivileged()))
Expand All @@ -161,7 +161,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn retry_invalid_state_error(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment("@bors retry").await?;
Expand All @@ -174,7 +174,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn retry_invalid_state_error_pending_build_hint(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.approve(()).await?;
Expand All @@ -194,7 +194,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn retry_auto_build(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.approve(()).await?;
Expand All @@ -213,7 +213,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn retry_apply_label(pool: sqlx::PgPool) {
let gh = GitHub::default().with_default_config(
r#"
Expand All @@ -237,7 +237,7 @@ auto_build_failed = ["-foo"]
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn cancel_no_running_build(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment("@bors cancel").await?;
Expand All @@ -247,7 +247,7 @@ auto_build_failed = ["-foo"]
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn cancel_while_try_build_is_running(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment("@bors try").await?;
Expand All @@ -263,7 +263,7 @@ auto_build_failed = ["-foo"]
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn cancel_cancel_workflows(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.approve(()).await?;
Expand All @@ -290,7 +290,7 @@ auto_build_failed = ["-foo"]
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn cancel_error(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.approve(()).await?;
Expand Down
2 changes: 1 addition & 1 deletion src/bors/handlers/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(super) async fn command_help(
mod tests {
use crate::tests::{BorsTester, run_test};

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn help_command(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment("@bors help").await?;
Expand Down
12 changes: 6 additions & 6 deletions src/bors/handlers/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub(super) async fn command_info(
mod tests {
use crate::tests::{BorsTester, WorkflowEvent, run_test};

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn info_for_unapproved_pr(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment("@bors info").await?;
Expand All @@ -109,7 +109,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn info_for_approved_pr(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.approve(()).await?;
Expand All @@ -129,7 +129,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn info_for_pr_with_priority(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment("@bors p=5").await?;
Expand All @@ -150,7 +150,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn info_for_pr_with_try_build(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment("@bors try").await?;
Expand All @@ -172,7 +172,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn info_for_pr_with_everything(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment("@bors r+ p=10").await?;
Expand Down Expand Up @@ -201,7 +201,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn info_cancelled_auto_build(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.approve(()).await?;
Expand Down
6 changes: 3 additions & 3 deletions src/bors/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ fn is_bors_observed_branch(branch: &str) -> bool {
mod tests {
use crate::tests::{BorsTester, Comment, User, run_test};

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn ignore_bot_comment(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment(Comment::from("@bors ping").with_author(User::bors_bot()))
Expand All @@ -1112,7 +1112,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn do_not_load_pr_on_unrelated_comment(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.modify_repo((), |repo| repo.pull_request_error = true);
Expand All @@ -1122,7 +1122,7 @@ mod tests {
.await;
}

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn unknown_command(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment(Comment::from("@bors foo")).await?;
Expand Down
2 changes: 1 addition & 1 deletion src/bors/handlers/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub(super) async fn command_ping(
mod tests {
use crate::tests::{BorsTester, run_test};

#[sqlx::test]
#[sqlx::test(migrator = "crate::MIGRATOR")]
async fn ping_command(pool: sqlx::PgPool) {
run_test(pool, async |ctx: &mut BorsTester| {
ctx.post_comment("@bors ping").await?;
Expand Down
Loading