@@ -11,7 +11,7 @@ use super::{CrateId, update_latest_version_id};
1111
1212/// List of directories in docs.rs's underlying storage (either the database or S3) containing a
1313/// 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"] ;
1515static OTHER_STORAGE_PATHS_TO_DELETE : & [ & str ] = & [ "sources" ] ;
1616
1717#[ derive( Debug , thiserror:: Error ) ]
@@ -222,6 +222,7 @@ mod tests {
222222 use super :: * ;
223223 use crate :: db:: ReleaseId ;
224224 use crate :: registry_api:: { CrateOwner , OwnerKind } ;
225+ use crate :: storage:: rustdoc_json_path;
225226 use crate :: test:: { async_wrapper, fake_release_that_failed_before_build} ;
226227 use test_case:: test_case;
227228
@@ -426,6 +427,17 @@ mod tests {
426427 . rustdoc_file_exists( "a" , "1.0.0" , None , "a/index.html" , archive_storage)
427428 . await ?
428429 ) ;
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+ ) ;
429441 let crate_id = sqlx:: query_scalar!(
430442 r#"SELECT crate_id as "crate_id: CrateId" FROM releases WHERE id = $1"# ,
431443 v1. 0
@@ -457,6 +469,17 @@ mod tests {
457469 . rustdoc_file_exists( "a" , "2.0.0" , None , "a/index.html" , archive_storage)
458470 . await ?
459471 ) ;
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+ ) ;
460483 assert_eq ! (
461484 owners( & mut conn, crate_id) . await ?,
462485 vec![ "Peter Rabbit" . to_string( ) ]
@@ -494,13 +517,36 @@ mod tests {
494517 . await ?
495518 ) ;
496519 }
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+
497532 assert ! ( release_exists( & mut conn, v2) . await ?) ;
498533 assert ! (
499534 env. async_storage( )
500535 . await
501536 . rustdoc_file_exists( "a" , "2.0.0" , None , "a/index.html" , archive_storage)
502537 . await ?
503538 ) ;
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+ ) ;
504550 assert_eq ! (
505551 owners( & mut conn, crate_id) . await ?,
506552 vec![ "Peter Rabbit" . to_string( ) ]
0 commit comments