@@ -789,8 +789,8 @@ mod tests {
789
789
use crate :: db:: types:: BuildStatus ;
790
790
use crate :: registry_api:: { CrateOwner , OwnerKind } ;
791
791
use crate :: test:: {
792
- assert_cache_control, assert_redirect, assert_redirect_unchecked, assert_success, wrapper ,
793
- FakeBuild , TestFrontend ,
792
+ assert_cache_control, assert_redirect, assert_redirect_unchecked, assert_success,
793
+ fake_release_that_failed_before_build , wrapper , FakeBuild , TestFrontend ,
794
794
} ;
795
795
use anyhow:: Error ;
796
796
use chrono:: { Duration , TimeZone } ;
@@ -1298,6 +1298,18 @@ mod tests {
1298
1298
. docsrs_version( "docs.rs 4.0.0" ) ] )
1299
1299
. create ( ) ?;
1300
1300
1301
+ // release that failed in the fetch-step, will miss some details
1302
+ env. runtime ( ) . block_on ( async {
1303
+ let mut conn = env. async_db ( ) . await . async_conn ( ) . await ;
1304
+ fake_release_that_failed_before_build (
1305
+ & mut conn,
1306
+ "failed_hard" ,
1307
+ "0.1.0" ,
1308
+ "some random error" ,
1309
+ )
1310
+ . await
1311
+ } ) ?;
1312
+
1301
1313
let _m = crates_io
1302
1314
. mock ( "GET" , "/api/v1/crates" )
1303
1315
. match_query ( Matcher :: AllOf ( vec ! [
@@ -1313,7 +1325,8 @@ mod tests {
1313
1325
{ "name" : "some_other_crate" } ,
1314
1326
{ "name" : "and_another_one" } ,
1315
1327
{ "name" : "yet_another_crate" } ,
1316
- { "name" : "in_progress" }
1328
+ { "name" : "in_progress" } ,
1329
+ { "name" : "failed_hard" }
1317
1330
] ,
1318
1331
"meta" : {
1319
1332
"next_page" : null,
@@ -1327,14 +1340,15 @@ mod tests {
1327
1340
let links = get_release_links ( "/releases/search?query=some_random_crate" , web) ?;
1328
1341
1329
1342
// `some_other_crate` won't be shown since we don't have it yet
1330
- assert_eq ! ( links. len( ) , 3 ) ;
1343
+ assert_eq ! ( links. len( ) , 4 ) ;
1331
1344
// * `max_version` from the crates.io search result will be ignored since we
1332
1345
// might not have it yet, or the doc-build might be in progress.
1333
1346
// * ranking/order from crates.io result is preserved
1334
1347
// * version used is the highest semver following our own "latest version" logic
1335
1348
assert_eq ! ( links[ 0 ] , "/some_random_crate/latest/some_random_crate/" ) ;
1336
1349
assert_eq ! ( links[ 1 ] , "/and_another_one/latest/and_another_one/" ) ;
1337
1350
assert_eq ! ( links[ 2 ] , "/yet_another_crate/0.1.0/yet_another_crate/" ) ;
1351
+ assert_eq ! ( links[ 3 ] , "/crate/failed_hard/0.1.0" ) ;
1338
1352
Ok ( ( ) )
1339
1353
} )
1340
1354
}
0 commit comments