From d3e4de0175bfb9e88656b977214714946db9ebdc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Oct 2019 15:33:58 -0400 Subject: [PATCH] fix test suite The test suite found a bug; select_ can fail now because a uniqueness constrain has been added. Now the test suite passes. Also, I'm satisfied the changed PersistField instances work. Looking over what changed, and what I've already tested, Key, FilePath, and InodeCache are known working; ContentIdentifier is trivial ByteString to blob; and SSha is trivial String to varchar. Both are tested by the test suite. I've also tested the new FileSize and EpochTime instances already, and they work. --- Database/ContentIdentifier.hs | 2 +- Test.hs | 6 +++--- doc/todo/sqlite_database_improvements.mdwn | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Database/ContentIdentifier.hs b/Database/ContentIdentifier.hs index 3e84824aea..522b80973e 100644 --- a/Database/ContentIdentifier.hs +++ b/Database/ContentIdentifier.hs @@ -94,7 +94,7 @@ flushDbQueue (ContentIdentifierHandle h) = H.flushDbQueue h -- Be sure to also update the git-annex branch when using this. recordContentIdentifier :: ContentIdentifierHandle -> RemoteStateHandle -> ContentIdentifier -> Key -> IO () recordContentIdentifier h (RemoteStateHandle u) cid k = queueDb h $ do - void $ insert_ $ ContentIdentifiers u cid k + void $ insertUnique $ ContentIdentifiers u cid k getContentIdentifiers :: ContentIdentifierHandle -> RemoteStateHandle -> Key -> IO [ContentIdentifier] getContentIdentifiers (ContentIdentifierHandle h) (RemoteStateHandle u) k = diff --git a/Test.hs b/Test.hs index be15365352..e6d4cc9b12 100644 --- a/Test.hs +++ b/Test.hs @@ -148,9 +148,9 @@ tests crippledfilesystem adjustedbranchok opts = map (\(d, te) -> withTestMode te initTests (unitTests d)) testmodes where testmodes = catMaybes - [ canadjust ("v7 adjusted unlocked branch", (testMode opts (RepoVersion 7)) { adjustedUnlockedBranch = True }) - , unlesscrippled ("v7 unlocked", (testMode opts (RepoVersion 7)) { unlockedFiles = True }) - , unlesscrippled ("v7 locked", testMode opts (RepoVersion 7)) + [ canadjust ("v8 adjusted unlocked branch", (testMode opts (RepoVersion 8)) { adjustedUnlockedBranch = True }) + , unlesscrippled ("v8 unlocked", (testMode opts (RepoVersion 8)) { unlockedFiles = True }) + , unlesscrippled ("v8 locked", testMode opts (RepoVersion 8)) ] unlesscrippled v | crippledfilesystem = Nothing diff --git a/doc/todo/sqlite_database_improvements.mdwn b/doc/todo/sqlite_database_improvements.mdwn index 0ccbbb3b1b..aee3bf6633 100644 --- a/doc/todo/sqlite_database_improvements.mdwn +++ b/doc/todo/sqlite_database_improvements.mdwn @@ -65,8 +65,6 @@ process. remaining todo: -* test all changed types in Database.Types serialize and deserialize - correctly * migration > Investigated this in more detail, and I can't find a way to