@@ -939,8 +939,6 @@ fn test_gcs_oauth_url() {
939939 } ;
940940}
941941
942-
943-
944942#[ test]
945943fn full_toml_parse ( ) {
946944 const CONFIG_STR : & str = r#"
@@ -967,11 +965,12 @@ size = 7516192768 # 7 GiBytes
967965
968966[cache.gcs]
969967# optional url
970- url = "..."
968+ deprecated_url = "..."
971969rw_mode = "READ_ONLY"
972970# rw_mode = "READ_WRITE"
973971cred_path = "/psst/secret/cred"
974972bucket = "bucket"
973+ key_prefix = "prefix"
975974
976975[cache.memcached]
977976url = "..."
983982bucket = "name"
984983endpoint = "s3-us-east-1.amazonaws.com"
985984use_ssl = true
985+ key_prefix = "s3prefix"
986986"# ;
987987
988988 let file_config: FileConfig = toml:: from_str ( CONFIG_STR ) . expect ( "Is valid toml." ) ;
989- assert_eq ! ( file_config,
989+ assert_eq ! (
990+ file_config,
990991 FileConfig {
991992 cache: CacheConfigs {
992993 azure: None , // TODO not sure how to represent a unit struct in TOML Some(AzureCacheConfig),
@@ -995,11 +996,12 @@ use_ssl = true
995996 size: 7 * 1024 * 1024 * 1024 ,
996997 } ) ,
997998 gcs: Some ( GCSCacheConfig {
998- url: Some ( "..." . to_owned( ) ) ,
999+ oauth_url: None ,
1000+ deprecated_url: Some ( "..." . to_owned( ) ) ,
9991001 bucket: "bucket" . to_owned( ) ,
10001002 cred_path: Some ( PathBuf :: from( "/psst/secret/cred" ) ) ,
10011003 rw_mode: GCSCacheRWMode :: ReadOnly ,
1002-
1004+ key_prefix : "prefix" . into ( ) ,
10031005 } ) ,
10041006 redis: Some ( RedisCacheConfig {
10051007 url
: "redis://user:[email protected] :6379/1" . to_owned
( ) , @@ -1011,12 +1013,19 @@ use_ssl = true
10111013 bucket: "name" . to_owned( ) ,
10121014 endpoint: "s3-us-east-1.amazonaws.com" . to_owned( ) ,
10131015 use_ssl: true ,
1016+ key_prefix: "s3prefix" . into( )
10141017 } ) ,
10151018 } ,
10161019 dist: DistConfig {
1017- auth: DistAuth :: Token { token: "secrettoken" . to_owned( ) } ,
1020+ auth: DistAuth :: Token {
1021+ token: "secrettoken" . to_owned( )
1022+ } ,
10181023 #[ cfg( any( feature = "dist-client" , feature = "dist-server" ) ) ]
1019- scheduler_url: Some ( parse_http_url( "http://1.2.3.4:10600" ) . map( |url| { HTTPUrl :: from_url( url) } ) . expect( "Scheduler url must be valid url str" ) ) ,
1024+ scheduler_url: Some (
1025+ parse_http_url( "http://1.2.3.4:10600" )
1026+ . map( |url| { HTTPUrl :: from_url( url) } )
1027+ . expect( "Scheduler url must be valid url str" )
1028+ ) ,
10201029 #[ cfg( not( any( feature = "dist-client" , feature = "dist-server" ) ) ) ]
10211030 scheduler_url: Some ( "http://1.2.3.4:10600" . to_owned( ) ) ,
10221031 cache_dir: PathBuf :: from( "/home/user/.cache/sccache-dist-client" ) ,
@@ -1026,4 +1035,4 @@ use_ssl = true
10261035 } ,
10271036 }
10281037 )
1029- }
1038+ }
0 commit comments