From 185e569de7f7a2b9609fea035aba54afcc64d46f Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Tue, 22 Aug 2017 00:06:23 +0530 Subject: [PATCH] Fix live-server test relating to incomplete uploads (#54) Minio server changed behaviour to return no incomplete uploads. This change is to make tests pass against the new server behaviour. --- test/LiveServer.hs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/LiveServer.hs b/test/LiveServer.hs index 0417a6c..a27cc89 100644 --- a/test/LiveServer.hs +++ b/test/LiveServer.hs @@ -263,7 +263,10 @@ liveServerUnitTests = testGroup "Unit tests against a live server" step "list incomplete multipart uploads" incompleteUploads <- listIncompleteUploads' bucket Nothing Nothing Nothing Nothing Nothing - liftIO $ (length $ lurUploads incompleteUploads) @?= 10 + -- Minio server behaviour changed to list no incomplete uploads, + -- so the check below reflects this; this test is expected to + -- fail on AWS S3. + liftIO $ (length $ lurUploads incompleteUploads) @?= 0 step "cleanup" forM_ (lurUploads incompleteUploads) $ @@ -286,7 +289,10 @@ liveServerUnitTests = testGroup "Unit tests against a live server" step "fetch list parts" listPartsResult <- listIncompleteParts' bucket object uid Nothing Nothing - liftIO $ (length $ lprParts listPartsResult) @?= 10 + -- Minio server behaviour changed to list no incomplete uploads, + -- so the check below reflects this; this test is expected to + -- fail on AWS S3. + liftIO $ (length $ lprParts listPartsResult) @?= 0 abortMultipartUpload bucket object uid step "High-level listObjects Test" @@ -314,7 +320,10 @@ liveServerUnitTests = testGroup "Unit tests against a live server" step "High-level listing of incomplete multipart uploads" uploads <- (listIncompleteUploads bucket Nothing True) $$ sinkList - liftIO $ (length uploads) @?= 10 + -- Minio server behaviour changed to list no incomplete uploads, + -- so the check below reflects this; this test is expected to + -- fail on AWS S3. + liftIO $ (length uploads) @?= 0 step "cleanup" forM_ uploads $ \(UploadInfo _ uid _ _) -> @@ -337,7 +346,10 @@ liveServerUnitTests = testGroup "Unit tests against a live server" step "fetch list parts" incompleteParts <- (listIncompleteParts bucket object uid) $$ sinkList - liftIO $ (length incompleteParts) @?= 10 + -- Minio server behaviour changed to list no incomplete uploads, + -- so the check below reflects this; this test is expected to + -- fail on AWS S3. + liftIO $ (length incompleteParts) @?= 0 step "cleanup" abortMultipartUpload bucket object uid