@@ -11,7 +11,7 @@ use super::{CrateId, update_latest_version_id};
11
11
12
12
/// List of directories in docs.rs's underlying storage (either the database or S3) containing a
13
13
/// subdirectory named after the crate. Those subdirectories will be deleted.
14
- static LIBRARY_STORAGE_PATHS_TO_DELETE : & [ & str ] = & [ "rustdoc" , "sources" ] ;
14
+ static LIBRARY_STORAGE_PATHS_TO_DELETE : & [ & str ] = & [ "rustdoc" , "rustdoc-json" , " sources"] ;
15
15
static OTHER_STORAGE_PATHS_TO_DELETE : & [ & str ] = & [ "sources" ] ;
16
16
17
17
#[ derive( Debug , thiserror:: Error ) ]
@@ -222,6 +222,7 @@ mod tests {
222
222
use super :: * ;
223
223
use crate :: db:: ReleaseId ;
224
224
use crate :: registry_api:: { CrateOwner , OwnerKind } ;
225
+ use crate :: storage:: rustdoc_json_path;
225
226
use crate :: test:: { async_wrapper, fake_release_that_failed_before_build} ;
226
227
use test_case:: test_case;
227
228
@@ -426,6 +427,17 @@ mod tests {
426
427
. rustdoc_file_exists( "a" , "1.0.0" , None , "a/index.html" , archive_storage)
427
428
. await ?
428
429
) ;
430
+ assert ! (
431
+ env. async_storage( )
432
+ . await
433
+ . exists( & rustdoc_json_path(
434
+ "a" ,
435
+ "1.0.0" ,
436
+ "x86_64-unknown-linux-gnu" ,
437
+ crate :: storage:: RustdocJsonFormatVersion :: Latest
438
+ ) )
439
+ . await ?
440
+ ) ;
429
441
let crate_id = sqlx:: query_scalar!(
430
442
r#"SELECT crate_id as "crate_id: CrateId" FROM releases WHERE id = $1"# ,
431
443
v1. 0
@@ -457,6 +469,17 @@ mod tests {
457
469
. rustdoc_file_exists( "a" , "2.0.0" , None , "a/index.html" , archive_storage)
458
470
. await ?
459
471
) ;
472
+ assert ! (
473
+ env. async_storage( )
474
+ . await
475
+ . exists( & rustdoc_json_path(
476
+ "a" ,
477
+ "2.0.0" ,
478
+ "x86_64-unknown-linux-gnu" ,
479
+ crate :: storage:: RustdocJsonFormatVersion :: Latest
480
+ ) )
481
+ . await ?
482
+ ) ;
460
483
assert_eq ! (
461
484
owners( & mut conn, crate_id) . await ?,
462
485
vec![ "Peter Rabbit" . to_string( ) ]
@@ -494,13 +517,36 @@ mod tests {
494
517
. await ?
495
518
) ;
496
519
}
520
+ assert ! (
521
+ !env. async_storage( )
522
+ . await
523
+ . exists( & rustdoc_json_path(
524
+ "a" ,
525
+ "1.0.0" ,
526
+ "x86_64-unknown-linux-gnu" ,
527
+ crate :: storage:: RustdocJsonFormatVersion :: Latest
528
+ ) )
529
+ . await ?
530
+ ) ;
531
+
497
532
assert ! ( release_exists( & mut conn, v2) . await ?) ;
498
533
assert ! (
499
534
env. async_storage( )
500
535
. await
501
536
. rustdoc_file_exists( "a" , "2.0.0" , None , "a/index.html" , archive_storage)
502
537
. await ?
503
538
) ;
539
+ assert ! (
540
+ env. async_storage( )
541
+ . await
542
+ . exists( & rustdoc_json_path(
543
+ "a" ,
544
+ "2.0.0" ,
545
+ "x86_64-unknown-linux-gnu" ,
546
+ crate :: storage:: RustdocJsonFormatVersion :: Latest
547
+ ) )
548
+ . await ?
549
+ ) ;
504
550
assert_eq ! (
505
551
owners( & mut conn, crate_id) . await ?,
506
552
vec![ "Peter Rabbit" . to_string( ) ]
0 commit comments