Avoid a test suite failure when the environment does not let gpg be tested
Due to eg, too long a path to the agent socket, caused by running gpg in a container where /run is not mounted, and/or some other gpg behavior like unnecessarily making relative paths to its home directory absolute.
This commit is contained in:
parent
24eabbbc55
commit
4a6d328ae9
5 changed files with 42 additions and 13 deletions
8
Test.hs
8
Test.hs
|
@ -1576,14 +1576,12 @@ test_crypto = do
|
|||
testscheme scheme = do
|
||||
abstmp <- absPath tmpdir
|
||||
testscheme' scheme abstmp
|
||||
testscheme' scheme abstmp = intmpclonerepo $ whenM (Utility.Path.inPath (Utility.Gpg.unGpgCmd gpgcmd)) $ do
|
||||
-- Use a relative path to avoid too long path to gpg's
|
||||
-- agent socket.
|
||||
testscheme' scheme abstmp = intmpclonerepo $ do
|
||||
gpgtmp <- (</> "gpgtmp") <$> relPathCwdToFile abstmp
|
||||
createDirectoryIfMissing False gpgtmp
|
||||
Utility.Gpg.testTestHarness gpgtmp gpgcmd
|
||||
Utility.Gpg.testTestHarness gpgtmp gpgcmd
|
||||
@? "test harness self-test failed"
|
||||
Utility.Gpg.testHarness gpgtmp gpgcmd $ do
|
||||
void $ Utility.Gpg.testHarness gpgtmp gpgcmd $ do
|
||||
createDirectory "dir"
|
||||
let a cmd = git_annex cmd $
|
||||
[ "foo"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue