Skip to content

Commit 80c62af

Browse files
committed
Rename db_client to db_pool
1 parent fa0510c commit 80c62af

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

database/src/pool.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ mod tests {
461461
// This is essentially testing the database testing framework is
462462
// wired up correctly. Though makes sense that there should be
463463
// an empty vector returned if there are no pstats.
464-
let db = ctx.db_client();
464+
let db = ctx.db_pool();
465465
let result = db.connection().await.get_pstats(&[], &[]).await;
466466
let expected: Vec<Vec<Option<f64>>> = vec![];
467467

@@ -474,7 +474,7 @@ mod tests {
474474
#[tokio::test]
475475
async fn artifact_storage() {
476476
run_db_test(|ctx| async {
477-
let db = ctx.db_client();
477+
let db = ctx.db_pool();
478478
let time = chrono::DateTime::from_str("2021-09-01T00:00:00.000Z").unwrap();
479479

480480
let artifact_one = ArtifactId::from(create_commit("abc", time, CommitType::Master));
@@ -518,7 +518,7 @@ mod tests {
518518
#[tokio::test]
519519
async fn multiple_requests_same_sha() {
520520
run_postgres_test(|ctx| async {
521-
let db = ctx.db_client();
521+
let db = ctx.db_pool();
522522
let db = db.connection().await;
523523
db.insert_benchmark_request(&BenchmarkRequest::create_master(
524524
"a-sha-1",
@@ -542,7 +542,7 @@ mod tests {
542542
#[tokio::test]
543543
async fn multiple_non_completed_try_requests() {
544544
run_postgres_test(|ctx| async {
545-
let db = ctx.db_client().connection().await;
545+
let db = ctx.db_pool().connection().await;
546546
let target = Target::X86_64UnknownLinuxGnu;
547547
let collector_name = "collector-1";
548548
let benchmark_set = 1;
@@ -584,7 +584,7 @@ mod tests {
584584
#[tokio::test]
585585
async fn multiple_master_requests_same_pr() {
586586
run_postgres_test(|ctx| async {
587-
let db = ctx.db_client();
587+
let db = ctx.db_pool();
588588
let db = db.connection().await;
589589

590590
db.insert_benchmark_request(&BenchmarkRequest::create_master(
@@ -613,7 +613,7 @@ mod tests {
613613
#[tokio::test]
614614
async fn load_pending_benchmark_requests() {
615615
run_postgres_test(|ctx| async {
616-
let db = ctx.db_client().connection().await;
616+
let db = ctx.db_pool().connection().await;
617617
let time = chrono::DateTime::from_str("2021-09-01T00:00:00.000Z").unwrap();
618618
let target = Target::X86_64UnknownLinuxGnu;
619619
let collector_name = "collector-1";
@@ -659,7 +659,7 @@ mod tests {
659659
#[tokio::test]
660660
async fn attach_shas_to_try_benchmark_request() {
661661
run_postgres_test(|ctx| async {
662-
let db = ctx.db_client();
662+
let db = ctx.db_pool();
663663
let db = db.connection().await;
664664

665665
let req = BenchmarkRequest::create_try_without_artifacts(42, "", "");
@@ -699,7 +699,7 @@ mod tests {
699699
#[tokio::test]
700700
async fn enqueue_benchmark_job() {
701701
run_postgres_test(|ctx| async {
702-
let db = ctx.db_client();
702+
let db = ctx.db_pool();
703703
let db = db.connection().await;
704704
let time = chrono::DateTime::from_str("2021-09-01T00:00:00.000Z").unwrap();
705705
let benchmark_request =
@@ -730,7 +730,7 @@ mod tests {
730730
#[tokio::test]
731731
async fn get_compile_test_cases_with_data() {
732732
run_db_test(|ctx| async {
733-
let db = ctx.db_client().connection().await;
733+
let db = ctx.db_pool().connection().await;
734734

735735
let collection = db.collection_id("test").await;
736736
let artifact = db
@@ -789,7 +789,7 @@ mod tests {
789789
#[tokio::test]
790790
async fn get_collector_config_error_if_not_exist() {
791791
run_postgres_test(|ctx| async {
792-
let db = ctx.db_client().connection().await;
792+
let db = ctx.db_pool().connection().await;
793793

794794
let collector_config_result = db.start_collector("collector-1", "foo").await.unwrap();
795795

@@ -803,7 +803,7 @@ mod tests {
803803
#[tokio::test]
804804
async fn add_collector_config() {
805805
run_postgres_test(|ctx| async {
806-
let db = ctx.db_client().connection().await;
806+
let db = ctx.db_pool().connection().await;
807807

808808
let mut inserted_config = db
809809
.add_collector_config("collector-1", Target::X86_64UnknownLinuxGnu, 1, true)
@@ -828,7 +828,7 @@ mod tests {
828828
#[tokio::test]
829829
async fn dequeue_benchmark_job_empty_queue() {
830830
run_postgres_test(|ctx| async {
831-
let db = ctx.db_client().connection().await;
831+
let db = ctx.db_pool().connection().await;
832832

833833
let benchmark_job_result = db
834834
.dequeue_benchmark_job(
@@ -849,7 +849,7 @@ mod tests {
849849
#[tokio::test]
850850
async fn dequeue_benchmark_job() {
851851
run_postgres_test(|ctx| async {
852-
let db = ctx.db_client().connection().await;
852+
let db = ctx.db_pool().connection().await;
853853
let time = chrono::DateTime::from_str("2021-09-01T00:00:00.000Z").unwrap();
854854

855855
let collector_config = db
@@ -918,7 +918,7 @@ mod tests {
918918
#[tokio::test]
919919
async fn mark_request_as_complete_empty() {
920920
run_postgres_test(|ctx| async {
921-
let db = ctx.db_client().connection().await;
921+
let db = ctx.db_pool().connection().await;
922922
let time = chrono::DateTime::from_str("2021-09-01T00:00:00.000Z").unwrap();
923923

924924
let insert_result = db
@@ -943,7 +943,7 @@ mod tests {
943943
#[tokio::test]
944944
async fn mark_request_as_complete() {
945945
run_postgres_test(|ctx| async {
946-
let db = ctx.db_client().connection().await;
946+
let db = ctx.db_pool().connection().await;
947947
let time = chrono::DateTime::from_str("2021-09-01T00:00:00.000Z").unwrap();
948948
let benchmark_set = BenchmarkSet(0u32);
949949
let tag = "sha-1";
@@ -1020,7 +1020,7 @@ mod tests {
10201020
#[tokio::test]
10211021
async fn get_status_page_data() {
10221022
run_postgres_test(|ctx| async {
1023-
let db = ctx.db_client().connection().await;
1023+
let db = ctx.db_pool().connection().await;
10241024
let benchmark_set = BenchmarkSet(0u32);
10251025
let time = chrono::DateTime::from_str("2021-09-01T00:00:00.000Z").unwrap();
10261026
let tag = "sha-1";
@@ -1157,7 +1157,7 @@ mod tests {
11571157
#[tokio::test]
11581158
async fn get_collector_configs() {
11591159
run_postgres_test(|ctx| async {
1160-
let db = ctx.db_client().connection().await;
1160+
let db = ctx.db_pool().connection().await;
11611161
let target = Target::X86_64UnknownLinuxGnu;
11621162

11631163
let benchmark_set_one = BenchmarkSet(0u32);

database/src/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl TestContext {
8383
}
8484
}
8585

86-
pub fn db_client(&self) -> &Pool {
86+
pub fn db_pool(&self) -> &Pool {
8787
&self.client
8888
}
8989

site/src/job_queue/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ mod tests {
391391
#[tokio::test]
392392
async fn queue_ordering() {
393393
run_postgres_test(|ctx| async {
394-
let db = ctx.db_client().connection().await;
394+
let db = ctx.db_pool().connection().await;
395395
let target = Target::X86_64UnknownLinuxGnu;
396396
let collector_name = "collector-1";
397397
let benchmark_set = 1;

0 commit comments

Comments
 (0)