Skip to content

Commit 3933437

Browse files
committed
Rename run_test to run_db_test
1 parent c64ed00 commit 3933437

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/db/review_prefs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ mod tests {
112112
use crate::db::review_prefs::{get_review_prefs, upsert_review_prefs};
113113
use crate::db::users::get_user;
114114
use crate::tests::github::user;
115-
use crate::tests::run_test;
115+
use crate::tests::run_db_test;
116116

117117
#[tokio::test]
118118
async fn insert_prefs_create_user() {
119-
run_test(|ctx| async {
119+
run_db_test(|ctx| async {
120120
let db = ctx.db_client().await;
121121

122122
let user = user("Martin", 1);
@@ -131,7 +131,7 @@ mod tests {
131131

132132
#[tokio::test]
133133
async fn insert_max_assigned_prs() {
134-
run_test(|ctx| async {
134+
run_db_test(|ctx| async {
135135
let db = ctx.db_client().await;
136136

137137
upsert_review_prefs(&db, user("Martin", 1), Some(5)).await?;
@@ -147,7 +147,7 @@ mod tests {
147147

148148
#[tokio::test]
149149
async fn update_max_assigned_prs() {
150-
run_test(|ctx| async {
150+
run_db_test(|ctx| async {
151151
let db = ctx.db_client().await;
152152

153153
upsert_review_prefs(&db, user("Martin", 1), Some(5)).await?;

src/db/users.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ WHERE user_id = $1;",
4141
#[cfg(test)]
4242
mod tests {
4343
use crate::db::users::{get_user, record_username};
44-
use crate::tests::run_test;
44+
use crate::tests::run_db_test;
4545

4646
#[tokio::test]
4747
async fn update_username_on_conflict() {
48-
run_test(|ctx| async {
48+
run_db_test(|ctx| async {
4949
let db = ctx.db_client().await;
5050

5151
record_username(&db, 1, "Foo").await?;

src/handlers/pr_tracking.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,11 @@ mod tests {
281281
use crate::github::{Label, PullRequestNumber};
282282
use crate::handlers::pr_tracking::{handle_input, parse_input, upsert_pr_into_user_queue};
283283
use crate::tests::github::{default_test_user, issue, pull_request, user};
284-
use crate::tests::{run_test, TestContext};
284+
use crate::tests::{run_db_test, TestContext};
285285

286286
#[tokio::test]
287287
async fn add_pr_to_workqueue_on_assign() {
288-
run_test(|ctx| async move {
288+
run_db_test(|ctx| async move {
289289
let user = user("Martin", 2);
290290

291291
run_handler(
@@ -332,7 +332,7 @@ mod tests {
332332

333333
#[tokio::test]
334334
async fn remove_pr_from_workqueue_on_unassign() {
335-
run_test(|ctx| async move {
335+
run_db_test(|ctx| async move {
336336
let user = user("Martin", 2);
337337
set_assigned_prs(&ctx, &user, &[10]).await;
338338

@@ -394,7 +394,7 @@ mod tests {
394394

395395
#[tokio::test]
396396
async fn remove_pr_from_workqueue_on_pr_closed() {
397-
run_test(|ctx| async move {
397+
run_db_test(|ctx| async move {
398398
let user = user("Martin", 2);
399399
set_assigned_prs(&ctx, &user, &[10]).await;
400400

@@ -417,7 +417,7 @@ mod tests {
417417

418418
#[tokio::test]
419419
async fn add_pr_to_workqueue_on_pr_reopen() {
420-
run_test(|ctx| async move {
420+
run_db_test(|ctx| async move {
421421
let user = user("Martin", 2);
422422
set_assigned_prs(&ctx, &user, &[42]).await;
423423

@@ -442,7 +442,7 @@ mod tests {
442442
// Make sure that we only consider pull requests, not issues.
443443
#[tokio::test]
444444
async fn ignore_issue_assignments() {
445-
run_test(|ctx| async move {
445+
run_db_test(|ctx| async move {
446446
let user = user("Martin", 2);
447447

448448
run_handler(

src/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl TestContext {
114114
}
115115
}
116116

117-
pub(crate) async fn run_test<F, Fut>(f: F)
117+
pub(crate) async fn run_db_test<F, Fut>(f: F)
118118
where
119119
F: FnOnce(TestContext) -> Fut,
120120
Fut: Future<Output = anyhow::Result<TestContext>>,

0 commit comments

Comments
 (0)