@@ -1314,28 +1314,40 @@ mod tests {
1314
1314
1315
1315
#[ tokio:: test]
1316
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 ( ) ;
1317
+ let builder = maybe_skip_integration ! ( ) ;
1318
+ let is_local = matches ! ( & builder. endpoint, Some ( e) if e. starts_with( "http://" ) ) ;
1320
1319
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 ;
1320
+ let test = |integration| async move {
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 ;
1327
+ } ;
1328
+
1329
+ let ( handle, shutdown) = dedicated_tokio ( ) ;
1330
+
1331
+ let integration = builder. clone ( ) . build ( ) . unwrap ( ) ;
1332
+ handle. block_on ( test ( integration) ) ;
1327
1333
1328
1334
// 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 ;
1335
+ let integration = builder. clone ( ) . with_unsigned_payload ( true ) . build ( ) . unwrap ( ) ;
1336
+ handle. block_on ( test ( integration) ) ;
1333
1337
1334
1338
// 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 ;
1339
+ let integration = builder
1340
+ . clone ( )
1341
+ . with_checksum_algorithm ( Checksum :: SHA256 )
1342
+ . build ( )
1343
+ . unwrap ( ) ;
1344
+ handle. block_on ( test ( integration) ) ;
1345
+
1346
+ // run integration test without tokio runtime
1347
+ let integration = builder. with_tokio_runtime ( handle) . build ( ) . unwrap ( ) ;
1348
+ futures:: executor:: block_on ( test ( integration) ) ;
1349
+
1350
+ shutdown ( ) ;
1339
1351
}
1340
1352
1341
1353
#[ tokio:: test]
0 commit comments