@@ -1019,10 +1019,8 @@ impl Default for BuildPackageSummary {
10191019#[ cfg( test) ]
10201020mod tests {
10211021 use super :: * ;
1022- use crate :: {
1023- db:: types:: Feature ,
1024- test:: { assert_redirect, assert_success, wrapper, TestEnvironment } ,
1025- } ;
1022+ use crate :: db:: types:: Feature ;
1023+ use crate :: test:: { wrapper, AxumRouterTestExt , TestEnvironment } ;
10261024
10271025 fn get_features (
10281026 env : & TestEnvironment ,
@@ -1149,7 +1147,8 @@ mod tests {
11491147 . collect ( ) ;
11501148 targets. sort ( ) ;
11511149
1152- let web = env. frontend ( ) ;
1150+ let runtime = env. runtime ( ) ;
1151+ let web = runtime. block_on ( env. web_app ( ) ) ;
11531152
11541153 // old rustdoc & source files are gone
11551154 assert ! ( !storage. exists( & old_rustdoc_file) ?) ;
@@ -1169,12 +1168,13 @@ mod tests {
11691168 None ,
11701169 & format!( "{crate_path}/index.html" ) ,
11711170 ) ?) ;
1172- assert_success ( & format ! ( "/{crate_}/{version}/{crate_path}" ) , web ) ?;
1171+ runtime . block_on ( web . assert_success ( & format ! ( "/{crate_}/{version}/{crate_path}/" ) ) ) ?;
11731172
11741173 // source is also packaged
11751174 assert ! ( storage. exists_in_archive( & source_archive, None , "src/lib.rs" , ) ?) ;
1176- assert_success ( & format ! ( "/crate/{crate_}/{version}/source/src/lib.rs" ) , web) ?;
1177-
1175+ runtime. block_on (
1176+ web. assert_success ( & format ! ( "/crate/{crate_}/{version}/source/src/lib.rs" ) ) ,
1177+ ) ?;
11781178 assert ! ( !storage. exists_in_archive(
11791179 & doc_archive,
11801180 None ,
@@ -1183,11 +1183,10 @@ mod tests {
11831183
11841184 let default_target_url =
11851185 format ! ( "/{crate_}/{version}/{default_target}/{crate_path}/index.html" ) ;
1186- assert_redirect (
1186+ runtime . block_on ( web . assert_redirect (
11871187 & default_target_url,
11881188 & format ! ( "/{crate_}/{version}/{crate_path}/index.html" ) ,
1189- web,
1190- ) ?;
1189+ ) ) ?;
11911190
11921191 // Non-dist toolchains only have a single target, and of course
11931192 // if include_default_targets is false we won't have this full list
@@ -1219,7 +1218,7 @@ mod tests {
12191218 format ! ( "/{crate_}/{version}/{target}/{crate_path}/index.html" ) ;
12201219
12211220 assert ! ( target_docs_present) ;
1222- assert_success ( & target_url, web ) ?;
1221+ runtime . block_on ( web . assert_success ( & target_url) ) ?;
12231222
12241223 assert ! ( storage
12251224 . exists( & format!( "build-logs/{}/{target}.txt" , row. build_id) )
@@ -1355,12 +1354,14 @@ mod tests {
13551354 None ,
13561355 & format ! ( "{target}/{crate_path}/index.html" ) ,
13571356 ) ?;
1357+ assert ! ( target_docs_present) ;
13581358
1359- let web = env. frontend ( ) ;
1360- let target_url = format ! ( "/{crate_}/{version}/{target}/{crate_path}/index.html" ) ;
1359+ env. runtime ( ) . block_on ( async {
1360+ let web = env. web_app ( ) . await ;
1361+ let target_url = format ! ( "/{crate_}/{version}/{target}/{crate_path}/index.html" ) ;
13611362
1362- assert ! ( target_docs_present ) ;
1363- assert_success ( & target_url , web ) ?;
1363+ web . assert_success ( & target_url ) . await
1364+ } ) ?;
13641365
13651366 Ok ( ( ) )
13661367 } ) ;
0 commit comments