Skip to content

Commit 9eac5a4

Browse files
committed
pr feedback
1 parent 34c63bf commit 9eac5a4

File tree

3 files changed

+13
-23
lines changed

3 files changed

+13
-23
lines changed

database/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ csv = "1"
2626
x509-cert = { version = "0.2.5", features = ["pem"] }
2727

2828
intern = { path = "../intern" }
29+
30+
[dev-dependencies]
2931
uuid = "1.16.0"

database/src/pool.rs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -341,39 +341,27 @@ mod tests {
341341
let artifact_two_id_number = db.connection().await.artifact_id(&artifact_two).await;
342342

343343
// We cannot arbitrarily add random sizes to the artifact size
344-
// table, as their is a constraint that the artifact must actually
344+
// table, as there is a constraint that the artifact must actually
345345
// exist before attaching something to it.
346346

347+
let db = db.connection().await;
348+
347349
// Artifact one inserts
348-
db.connection()
349-
.await
350-
.record_artifact_size(artifact_one_id_number, "llvm.so", 32)
350+
db.record_artifact_size(artifact_one_id_number, "llvm.so", 32)
351351
.await;
352-
db.connection()
353-
.await
354-
.record_artifact_size(artifact_one_id_number, "llvm.a", 64)
352+
db.record_artifact_size(artifact_one_id_number, "llvm.a", 64)
355353
.await;
356354

357355
// Artifact two inserts
358-
db.connection()
359-
.await
360-
.record_artifact_size(artifact_two_id_number, "another-llvm.a", 128)
356+
db.record_artifact_size(artifact_two_id_number, "another-llvm.a", 128)
361357
.await;
362358

363-
let result_one = db
364-
.connection()
365-
.await
366-
.get_artifact_size(artifact_one_id_number)
367-
.await;
368-
let result_two = db
369-
.connection()
370-
.await
371-
.get_artifact_size(artifact_two_id_number)
372-
.await;
359+
let result_one = db.get_artifact_size(artifact_one_id_number).await;
360+
let result_two = db.get_artifact_size(artifact_two_id_number).await;
373361

374362
// artifact one
375-
assert_eq!(Some(32 as u64), result_one.get("llvm.so").copied());
376-
assert_eq!(Some(64 as u64), result_one.get("llvm.a").copied());
363+
assert_eq!(Some(32u64), result_one.get("llvm.so").copied());
364+
assert_eq!(Some(64u64), result_one.get("llvm.a").copied());
377365
assert_eq!(None, result_one.get("another-llvm.a").copied());
378366

379367
// artifact two

database/src/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ where
9898
let ctx = f(ctx).await.expect("Test failed");
9999
ctx.finish().await;
100100
} else {
101-
eprintln!("Skipping test because TEST_DB_URL was not passed");
101+
panic!("Skipping test because TEST_DB_URL was not passed");
102102
}
103103
}

0 commit comments

Comments
 (0)