Skip to content

Commit e5c28d9

Browse files
committed
rnames
1 parent 792480b commit e5c28d9

File tree

11 files changed

+82
-87
lines changed

11 files changed

+82
-87
lines changed

src/build_queue.rs

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ mod tests {
738738

739739
#[tokio::test(flavor = "multi_thread")]
740740
async fn test_rebuild_when_old() -> Result<()> {
741-
let env = TestEnvironment::with_config_async(
741+
let env = TestEnvironment::with_config(
742742
TestEnvironment::base_config()
743743
.max_queued_rebuilds(Some(100))
744744
.build()?,
@@ -772,7 +772,7 @@ mod tests {
772772

773773
#[tokio::test(flavor = "multi_thread")]
774774
async fn test_still_rebuild_when_full_with_failed() -> Result<()> {
775-
let env = TestEnvironment::with_config_async(
775+
let env = TestEnvironment::with_config(
776776
TestEnvironment::base_config()
777777
.max_queued_rebuilds(Some(1))
778778
.build()?,
@@ -814,7 +814,7 @@ mod tests {
814814

815815
#[tokio::test(flavor = "multi_thread")]
816816
async fn test_dont_rebuild_when_full() -> Result<()> {
817-
let env = TestEnvironment::with_config_async(
817+
let env = TestEnvironment::with_config(
818818
TestEnvironment::base_config()
819819
.max_queued_rebuilds(Some(1))
820820
.build()?,
@@ -852,7 +852,7 @@ mod tests {
852852

853853
#[tokio::test(flavor = "multi_thread")]
854854
async fn test_add_duplicate_doesnt_fail_last_priority_wins() -> Result<()> {
855-
let env = TestEnvironment::new_async().await;
855+
let env = TestEnvironment::new().await;
856856

857857
let queue = env.async_build_queue();
858858

@@ -868,10 +868,9 @@ mod tests {
868868

869869
#[tokio::test(flavor = "multi_thread")]
870870
async fn test_add_duplicate_resets_attempts_and_priority() -> Result<()> {
871-
let env = TestEnvironment::with_config_async(
872-
TestEnvironment::base_config().build_attempts(5).build()?,
873-
)
874-
.await;
871+
let env =
872+
TestEnvironment::with_config(TestEnvironment::base_config().build_attempts(5).build()?)
873+
.await;
875874

876875
let queue = env.async_build_queue();
877876

@@ -908,7 +907,7 @@ mod tests {
908907

909908
#[tokio::test(flavor = "multi_thread")]
910909
async fn test_has_build_queued() -> Result<()> {
911-
let env = TestEnvironment::new_async().await;
910+
let env = TestEnvironment::new().await;
912911

913912
let queue = env.async_build_queue();
914913

@@ -929,7 +928,7 @@ mod tests {
929928

930929
#[test]
931930
fn test_wait_between_build_attempts() -> Result<()> {
932-
let env = TestEnvironment::with_config(
931+
let env = TestEnvironment::with_config_and_runtime(
933932
TestEnvironment::base_config()
934933
.build_attempts(99)
935934
.delay_between_build_attempts(Duration::from_secs(1))
@@ -980,7 +979,7 @@ mod tests {
980979
#[test]
981980
fn test_add_and_process_crates() -> Result<()> {
982981
const MAX_ATTEMPTS: u16 = 3;
983-
let env = TestEnvironment::with_config(
982+
let env = TestEnvironment::with_config_and_runtime(
984983
TestEnvironment::base_config()
985984
.build_attempts(MAX_ATTEMPTS)
986985
.delay_between_build_attempts(Duration::ZERO)
@@ -1071,7 +1070,7 @@ mod tests {
10711070

10721071
#[test]
10731072
fn test_invalidate_cdn_after_build_and_error() -> Result<()> {
1074-
let env = TestEnvironment::with_config(
1073+
let env = TestEnvironment::with_config_and_runtime(
10751074
TestEnvironment::base_config()
10761075
.cloudfront_distribution_id_web(Some("distribution_id_web".into()))
10771076
.cloudfront_distribution_id_static(Some("distribution_id_static".into()))
@@ -1126,7 +1125,7 @@ mod tests {
11261125

11271126
#[test]
11281127
fn test_pending_count() -> Result<()> {
1129-
let env = TestEnvironment::new();
1128+
let env = TestEnvironment::new_with_runtime();
11301129

11311130
let queue = env.build_queue();
11321131

@@ -1149,7 +1148,7 @@ mod tests {
11491148

11501149
#[test]
11511150
fn test_prioritized_count() -> Result<()> {
1152-
let env = TestEnvironment::new();
1151+
let env = TestEnvironment::new_with_runtime();
11531152

11541153
let queue = env.build_queue();
11551154

@@ -1172,7 +1171,7 @@ mod tests {
11721171

11731172
#[test]
11741173
fn test_count_by_priority() -> Result<()> {
1175-
let env = TestEnvironment::new();
1174+
let env = TestEnvironment::new_with_runtime();
11761175

11771176
let queue = env.build_queue();
11781177

@@ -1197,7 +1196,7 @@ mod tests {
11971196

11981197
#[test]
11991198
fn test_failed_count_for_reattempts() -> Result<()> {
1200-
let env = TestEnvironment::with_config(
1199+
let env = TestEnvironment::with_config_and_runtime(
12011200
TestEnvironment::base_config()
12021201
.build_attempts(MAX_ATTEMPTS)
12031202
.delay_between_build_attempts(Duration::ZERO)
@@ -1236,7 +1235,7 @@ mod tests {
12361235

12371236
#[test]
12381237
fn test_failed_count_after_error() -> Result<()> {
1239-
let env = TestEnvironment::with_config(
1238+
let env = TestEnvironment::with_config_and_runtime(
12401239
TestEnvironment::base_config()
12411240
.build_attempts(MAX_ATTEMPTS)
12421241
.delay_between_build_attempts(Duration::ZERO)
@@ -1272,7 +1271,7 @@ mod tests {
12721271

12731272
#[test]
12741273
fn test_queued_crates() -> Result<()> {
1275-
let env = TestEnvironment::new();
1274+
let env = TestEnvironment::new_with_runtime();
12761275

12771276
let queue = env.build_queue();
12781277

@@ -1303,7 +1302,7 @@ mod tests {
13031302

13041303
#[test]
13051304
fn test_last_seen_reference_in_db() -> Result<()> {
1306-
let env = TestEnvironment::new();
1305+
let env = TestEnvironment::new_with_runtime();
13071306

13081307
let queue = env.build_queue();
13091308
queue.unlock()?;
@@ -1325,7 +1324,7 @@ mod tests {
13251324

13261325
#[test]
13271326
fn test_broken_db_reference_breaks() -> Result<()> {
1328-
let env = TestEnvironment::new();
1327+
let env = TestEnvironment::new_with_runtime();
13291328

13301329
env.runtime().block_on(async {
13311330
let mut conn = env.async_db().async_conn().await;
@@ -1342,7 +1341,7 @@ mod tests {
13421341

13431342
#[test]
13441343
fn test_queue_lock() -> Result<()> {
1345-
let env = TestEnvironment::new();
1344+
let env = TestEnvironment::new_with_runtime();
13461345

13471346
let queue = env.build_queue();
13481347
// unlocked without config
@@ -1359,7 +1358,7 @@ mod tests {
13591358

13601359
#[test]
13611360
fn test_add_long_name() -> Result<()> {
1362-
let env = TestEnvironment::new();
1361+
let env = TestEnvironment::new_with_runtime();
13631362

13641363
let queue = env.build_queue();
13651364

@@ -1377,7 +1376,7 @@ mod tests {
13771376

13781377
#[test]
13791378
fn test_add_long_version() -> Result<()> {
1380-
let env = TestEnvironment::new();
1379+
let env = TestEnvironment::new_with_runtime();
13811380

13821381
let queue = env.build_queue();
13831382

src/cdn.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ mod tests {
703703

704704
#[tokio::test(flavor = "multi_thread")]
705705
async fn create_cloudfront() -> Result<()> {
706-
let env = TestEnvironment::with_config_async(
706+
let env = TestEnvironment::with_config(
707707
TestEnvironment::base_config()
708708
.cdn_backend(CdnKind::CloudFront)
709709
.build()?,
@@ -720,7 +720,7 @@ mod tests {
720720

721721
#[tokio::test(flavor = "multi_thread")]
722722
async fn create_dummy() {
723-
let env = TestEnvironment::new_async().await;
723+
let env = TestEnvironment::new().await;
724724

725725
assert!(matches!(*env.cdn(), CdnBackend::Dummy { .. }));
726726
assert!(matches!(
@@ -731,7 +731,7 @@ mod tests {
731731

732732
#[tokio::test(flavor = "multi_thread")]
733733
async fn invalidation_counts_are_zero_with_empty_queue() -> Result<()> {
734-
let env = TestEnvironment::with_config_async(config_with_cdn().build()?).await;
734+
let env = TestEnvironment::with_config(config_with_cdn().build()?).await;
735735

736736
let config = env.config();
737737
let mut conn = env.async_db().async_conn().await;
@@ -752,7 +752,7 @@ mod tests {
752752

753753
#[tokio::test(flavor = "multi_thread")]
754754
async fn escalate_to_full_invalidation() -> Result<()> {
755-
let env = TestEnvironment::with_config_async(
755+
let env = TestEnvironment::with_config(
756756
config_with_cdn()
757757
.cdn_max_queued_age(Duration::from_secs(0))
758758
.build()?,
@@ -859,7 +859,7 @@ mod tests {
859859

860860
#[tokio::test(flavor = "multi_thread")]
861861
async fn invalidate_a_crate() -> Result<()> {
862-
let env = TestEnvironment::with_config_async(config_with_cdn().build()?).await;
862+
let env = TestEnvironment::with_config(config_with_cdn().build()?).await;
863863

864864
let cdn = env.cdn();
865865
let config = env.config();
@@ -990,7 +990,7 @@ mod tests {
990990

991991
#[tokio::test(flavor = "multi_thread")]
992992
async fn only_add_some_invalidations_when_too_many_are_active() -> Result<()> {
993-
let env = TestEnvironment::with_config_async(config_with_cdn().build()?).await;
993+
let env = TestEnvironment::with_config(config_with_cdn().build()?).await;
994994

995995
let cdn = env.cdn();
996996

@@ -1064,7 +1064,7 @@ mod tests {
10641064

10651065
#[tokio::test(flavor = "multi_thread")]
10661066
async fn dont_create_invalidations_when_too_many_are_active() -> Result<()> {
1067-
let env = TestEnvironment::with_config_async(config_with_cdn().build()?).await;
1067+
let env = TestEnvironment::with_config(config_with_cdn().build()?).await;
10681068

10691069
let cdn = env.cdn();
10701070

@@ -1153,7 +1153,7 @@ mod tests {
11531153

11541154
#[tokio::test(flavor = "multi_thread")]
11551155
async fn dont_create_invalidations_without_paths() -> Result<()> {
1156-
let env = TestEnvironment::with_config_async(config_with_cdn().build()?).await;
1156+
let env = TestEnvironment::with_config(config_with_cdn().build()?).await;
11571157

11581158
let cdn = env.cdn();
11591159

src/docbuilder/limits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ mod test {
155155

156156
#[tokio::test(flavor = "multi_thread")]
157157
async fn config_default_memory_limit() -> Result<()> {
158-
let env = TestEnvironment::with_config_async(
158+
let env = TestEnvironment::with_config(
159159
TestEnvironment::base_config()
160160
.build_default_memory_limit(Some(6 * GB))
161161
.build()?,

0 commit comments

Comments
 (0)