@@ -1019,10 +1019,8 @@ impl Default for BuildPackageSummary {
1019
1019
#[ cfg( test) ]
1020
1020
mod tests {
1021
1021
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 } ;
1026
1024
1027
1025
fn get_features (
1028
1026
env : & TestEnvironment ,
@@ -1149,7 +1147,8 @@ mod tests {
1149
1147
. collect ( ) ;
1150
1148
targets. sort ( ) ;
1151
1149
1152
- let web = env. frontend ( ) ;
1150
+ let runtime = env. runtime ( ) ;
1151
+ let web = runtime. block_on ( env. web_app ( ) ) ;
1153
1152
1154
1153
// old rustdoc & source files are gone
1155
1154
assert ! ( !storage. exists( & old_rustdoc_file) ?) ;
@@ -1169,12 +1168,13 @@ mod tests {
1169
1168
None ,
1170
1169
& format!( "{crate_path}/index.html" ) ,
1171
1170
) ?) ;
1172
- assert_success ( & format ! ( "/{crate_}/{version}/{crate_path}" ) , web ) ?;
1171
+ runtime . block_on ( web . assert_success ( & format ! ( "/{crate_}/{version}/{crate_path}/" ) ) ) ?;
1173
1172
1174
1173
// source is also packaged
1175
1174
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
+ ) ?;
1178
1178
assert ! ( !storage. exists_in_archive(
1179
1179
& doc_archive,
1180
1180
None ,
@@ -1183,11 +1183,10 @@ mod tests {
1183
1183
1184
1184
let default_target_url =
1185
1185
format ! ( "/{crate_}/{version}/{default_target}/{crate_path}/index.html" ) ;
1186
- assert_redirect (
1186
+ runtime . block_on ( web . assert_redirect (
1187
1187
& default_target_url,
1188
1188
& format ! ( "/{crate_}/{version}/{crate_path}/index.html" ) ,
1189
- web,
1190
- ) ?;
1189
+ ) ) ?;
1191
1190
1192
1191
// Non-dist toolchains only have a single target, and of course
1193
1192
// if include_default_targets is false we won't have this full list
@@ -1219,7 +1218,7 @@ mod tests {
1219
1218
format ! ( "/{crate_}/{version}/{target}/{crate_path}/index.html" ) ;
1220
1219
1221
1220
assert ! ( target_docs_present) ;
1222
- assert_success ( & target_url, web ) ?;
1221
+ runtime . block_on ( web . assert_success ( & target_url) ) ?;
1223
1222
1224
1223
assert ! ( storage
1225
1224
. exists( & format!( "build-logs/{}/{target}.txt" , row. build_id) )
@@ -1355,12 +1354,14 @@ mod tests {
1355
1354
None ,
1356
1355
& format ! ( "{target}/{crate_path}/index.html" ) ,
1357
1356
) ?;
1357
+ assert ! ( target_docs_present) ;
1358
1358
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" ) ;
1361
1362
1362
- assert ! ( target_docs_present ) ;
1363
- assert_success ( & target_url , web ) ?;
1363
+ web . assert_success ( & target_url ) . await
1364
+ } ) ?;
1364
1365
1365
1366
Ok ( ( ) )
1366
1367
} ) ;
0 commit comments