diff options
author | 2014-08-03 18:08:34 -0400 | |
---|---|---|
committer | 2014-08-03 18:08:34 -0400 | |
commit | 3b80e1385001771ee1ec1121967e0d832191d8f0 (patch) | |
tree | 75fb1ad20533b0fc83df1da1f826c5b90dc77e44 | |
parent | 845c4492a98498f1a77c34bf06cb8e7879cc28fc (diff) |
testremote --fast
-rw-r--r-- | Command/TestRemote.hs | 20 | ||||
-rw-r--r-- | doc/git-annex.mdwn | 2 |
2 files changed, 16 insertions, 6 deletions
diff --git a/Command/TestRemote.hs b/Command/TestRemote.hs index 29a2e809c..f68d391b1 100644 --- a/Command/TestRemote.hs +++ b/Command/TestRemote.hs @@ -59,8 +59,9 @@ start basesz ws = do showStart "testremote" name r <- either error id <$> Remote.byName' name showSideAction "generating test keys" - ks <- mapM randKey (keySizes basesz) - rs <- catMaybes <$> mapM (adjustChunkSize r) (chunkSizes basesz) + fast <- Annex.getState Annex.fast + ks <- mapM randKey (keySizes basesz fast) + rs <- catMaybes <$> mapM (adjustChunkSize r) (chunkSizes basesz fast) rs' <- concat <$> mapM encryptionVariants rs next $ perform rs' ks @@ -161,22 +162,29 @@ cleanup rs ks ok = do forM_ ks removeAnnex return ok -chunkSizes :: Int -> [Int] -chunkSizes base = +chunkSizes :: Int -> Bool -> [Int] +chunkSizes base False = [ 0 -- no chunking , base `div` 100 , base `div` 1000 , base ] +chunkSizes base True = + [ 0 + ] -keySizes :: Int -> [Int] -keySizes base = filter (>= 0) +keySizes :: Int -> Bool -> [Int] +keySizes base fast = filter want [ 0 -- empty key is a special case when chunking , base , base + 1 , base - 1 , base * 2 ] + where + want sz + | fast = sz <= base && sz > 0 + | otherwise = sz > 0 randKey :: Int -> Annex Key randKey sz = withTmpFile "randkey" $ \f h -> do diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index ba851eef8..673e86fc9 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -974,6 +974,8 @@ subdirectories). It's safe to run in an existing repository (the repository contents are not altered), although it may perform expensive data transfers. + To perform a smaller set of tests, use --fast. + The --size option can be used to tune the size of the generated objects. Testing a single remote will use the remote's configuration, |