File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -1363,6 +1363,49 @@ mod tests {
1363
1363
} ) ;
1364
1364
}
1365
1365
1366
+ #[ test]
1367
+ #[ ignore]
1368
+ fn test_build_failures_before_build ( ) {
1369
+ wrapper ( |env| {
1370
+ // https://github.com/rust-lang/docs.rs/issues/2491
1371
+ // package without cargo.toml, so fails directly in the fetch stage.
1372
+ let crate_ = "emheap" ;
1373
+ let version = "0.1.0" ;
1374
+ let mut builder = RustwideBuilder :: init ( env) . unwrap ( ) ;
1375
+ builder. update_toolchain ( ) ?;
1376
+
1377
+ // `Result` is `Ok`, but the build-result is `false`
1378
+ assert ! ( !builder. build_package( crate_, version, PackageKind :: CratesIo ) ?) ;
1379
+
1380
+ let row = env. runtime ( ) . block_on ( async {
1381
+ let mut conn = env. async_db ( ) . await . async_conn ( ) . await ;
1382
+ sqlx:: query!(
1383
+ r#"SELECT
1384
+ rustc_version,
1385
+ docsrs_version,
1386
+ build_status as "build_status: BuildStatus",
1387
+ errors
1388
+ FROM
1389
+ crates as c
1390
+ INNER JOIN releases as r on c.id = r.crate_id
1391
+ INNER JOIN builds as b on b.rid = r.id
1392
+ WHERE c.name = $1 and r.version = $2"# ,
1393
+ crate_,
1394
+ version,
1395
+ )
1396
+ . fetch_one ( & mut * conn)
1397
+ . await
1398
+ } ) ?;
1399
+
1400
+ assert ! ( row. rustc_version. is_none( ) ) ;
1401
+ assert ! ( row. docsrs_version. is_none( ) ) ;
1402
+ assert_eq ! ( row. build_status, BuildStatus :: Failure ) ;
1403
+ assert_eq ! ( row. errors, Some ( "error message" . into( ) ) ) ;
1404
+
1405
+ Ok ( ( ) )
1406
+ } ) ;
1407
+ }
1408
+
1366
1409
#[ test]
1367
1410
#[ ignore]
1368
1411
fn test_implicit_features_for_optional_dependencies ( ) {
You can’t perform that action at this time.
0 commit comments