@@ -1297,45 +1297,42 @@ mod tests {
1297
1297
assert ! ( builder. is_err( ) ) ;
1298
1298
}
1299
1299
1300
- #[ test]
1301
- fn s3_test_non_tokio ( ) {
1302
- let ( handle, shutdown) = dedicated_tokio ( ) ;
1303
- let config = maybe_skip_integration ! ( ) ;
1304
- let integration = config. with_tokio_runtime ( handle) . build ( ) . unwrap ( ) ;
1305
- futures:: executor:: block_on ( async move {
1306
- put_get_delete_list_opts ( & integration, true ) . await ;
1300
+ #[ tokio:: test]
1301
+ async fn s3_test ( ) {
1302
+ let builder = maybe_skip_integration ! ( ) ;
1303
+ let is_local = matches ! ( & builder. endpoint, Some ( e) if e. starts_with( "http://" ) ) ;
1304
+
1305
+ let test = |integration| async move {
1306
+ // Localstack doesn't support listing with spaces https://github.com/localstack/localstack/issues/6328
1307
+ put_get_delete_list_opts ( & integration, is_local) . await ;
1307
1308
list_uses_directories_correctly ( & integration) . await ;
1308
1309
list_with_delimiter ( & integration) . await ;
1309
1310
rename_and_copy ( & integration) . await ;
1310
1311
stream_get ( & integration) . await ;
1311
- } ) ;
1312
- shutdown ( ) ;
1313
- }
1312
+ } ;
1314
1313
1315
- #[ tokio:: test]
1316
- async fn s3_test ( ) {
1317
- let config = maybe_skip_integration ! ( ) ;
1318
- let is_local = matches ! ( & config. endpoint, Some ( e) if e. starts_with( "http://" ) ) ;
1319
- let integration = config. build ( ) . unwrap ( ) ;
1314
+ let ( handle, shutdown) = dedicated_tokio ( ) ;
1320
1315
1321
- // Localstack doesn't support listing with spaces https://github.com/localstack/localstack/issues/6328
1322
- put_get_delete_list_opts ( & integration, is_local) . await ;
1323
- list_uses_directories_correctly ( & integration) . await ;
1324
- list_with_delimiter ( & integration) . await ;
1325
- rename_and_copy ( & integration) . await ;
1326
- stream_get ( & integration) . await ;
1316
+ let integration = builder. clone ( ) . build ( ) . unwrap ( ) ;
1317
+ handle. block_on ( test ( integration) ) ;
1327
1318
1328
1319
// run integration test with unsigned payload enabled
1329
- let config = maybe_skip_integration ! ( ) . with_unsigned_payload ( true ) ;
1330
- let is_local = matches ! ( & config. endpoint, Some ( e) if e. starts_with( "http://" ) ) ;
1331
- let integration = config. build ( ) . unwrap ( ) ;
1332
- put_get_delete_list_opts ( & integration, is_local) . await ;
1320
+ let integration = builder. clone ( ) . with_unsigned_payload ( true ) . build ( ) . unwrap ( ) ;
1321
+ handle. block_on ( test ( integration) ) ;
1333
1322
1334
1323
// run integration test with checksum set to sha256
1335
- let config = maybe_skip_integration ! ( ) . with_checksum_algorithm ( Checksum :: SHA256 ) ;
1336
- let is_local = matches ! ( & config. endpoint, Some ( e) if e. starts_with( "http://" ) ) ;
1337
- let integration = config. build ( ) . unwrap ( ) ;
1338
- put_get_delete_list_opts ( & integration, is_local) . await ;
1324
+ let integration = builder
1325
+ . clone ( )
1326
+ . with_checksum_algorithm ( Checksum :: SHA256 )
1327
+ . build ( )
1328
+ . unwrap ( ) ;
1329
+ handle. block_on ( test ( integration) ) ;
1330
+
1331
+ // run integration test without tokio runtime
1332
+ let integration = builder. with_tokio_runtime ( handle) . build ( ) . unwrap ( ) ;
1333
+ futures:: executor:: block_on ( test ( integration) ) ;
1334
+
1335
+ shutdown ( ) ;
1339
1336
}
1340
1337
1341
1338
#[ tokio:: test]
0 commit comments