set up git email config in clone repos too when running test
This fixes the problem of the environment variables apparently not being seen on Windows. I could probably remove the setting of the env vars from Test.hs now as this covers it better. Note that outside the test suite, git-annex on windows seems to manage to configure the repo so commits work on its own.
This commit is contained in:
parent
83e6fb7319
commit
5d7777cbe2
2 changed files with 9 additions and 9 deletions
13
Test.hs
13
Test.hs
|
@ -948,7 +948,8 @@ test_rsync_remote env = intmpclonerepo env $ do
|
||||||
not <$> git_annex env "drop" [annexedfile, "--numcopies=2"] @? "drop failed to fail"
|
not <$> git_annex env "drop" [annexedfile, "--numcopies=2"] @? "drop failed to fail"
|
||||||
annexed_present annexedfile
|
annexed_present annexedfile
|
||||||
#else
|
#else
|
||||||
-- this test doesn't work in Windows TODO
|
-- Rsync remotes with a rsyncurl of a directory do not currently
|
||||||
|
-- work on Windows.
|
||||||
noop
|
noop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1140,9 +1141,7 @@ setuprepo env dir = do
|
||||||
cleanup dir
|
cleanup dir
|
||||||
ensuretmpdir
|
ensuretmpdir
|
||||||
boolSystem "git" [Params "init -q", File dir] @? "git init failed"
|
boolSystem "git" [Params "init -q", File dir] @? "git init failed"
|
||||||
indir env dir $ do
|
configrepo env dir
|
||||||
boolSystem "git" [Params "config user.name", Param "Test User"] @? "git config failed"
|
|
||||||
boolSystem "git" [Params "config user.email test@example.com"] @? "git config failed"
|
|
||||||
return dir
|
return dir
|
||||||
|
|
||||||
-- clones are always done as local clones; we cannot test ssh clones
|
-- clones are always done as local clones; we cannot test ssh clones
|
||||||
|
@ -1154,11 +1153,17 @@ clonerepo env old new bare = do
|
||||||
boolSystem "git" [Params ("clone -q" ++ b), File old, File new] @? "git clone failed"
|
boolSystem "git" [Params ("clone -q" ++ b), File old, File new] @? "git clone failed"
|
||||||
indir env new $
|
indir env new $
|
||||||
git_annex env "init" ["-q", new] @? "git annex init failed"
|
git_annex env "init" ["-q", new] @? "git annex init failed"
|
||||||
|
configrepo env new
|
||||||
when (not bare) $
|
when (not bare) $
|
||||||
indir env new $
|
indir env new $
|
||||||
handleforcedirect env
|
handleforcedirect env
|
||||||
return new
|
return new
|
||||||
|
|
||||||
|
configrepo :: TestEnv -> FilePath -> IO ()
|
||||||
|
configrepo env dir = indir env dir $ do
|
||||||
|
boolSystem "git" [Params "config user.name", Param "Test User"] @? "git config failed"
|
||||||
|
boolSystem "git" [Params "config user.email test@example.com"] @? "git config failed"
|
||||||
|
|
||||||
handleforcedirect :: TestEnv -> IO ()
|
handleforcedirect :: TestEnv -> IO ()
|
||||||
handleforcedirect env = when (M.lookup "FORCEDIRECT" env == Just "1") $
|
handleforcedirect env = when (M.lookup "FORCEDIRECT" env == Just "1") $
|
||||||
git_annex env "direct" ["-q"] @? "git annex direct failed"
|
git_annex env "direct" ["-q"] @? "git annex direct failed"
|
||||||
|
|
|
@ -13,11 +13,6 @@ now! --[[Joey]]
|
||||||
* Ssh connection caching does not work on Windows, so `git annex get`
|
* Ssh connection caching does not work on Windows, so `git annex get`
|
||||||
has to connect twice to the remote system over ssh per file, which
|
has to connect twice to the remote system over ssh per file, which
|
||||||
is much slower than on systems supporting connection caching.
|
is much slower than on systems supporting connection caching.
|
||||||
* The test suite does not 100% pass, although it seems to be getting
|
|
||||||
quite close! Current known failures:
|
|
||||||
* Some tests fail if git has not had the username and email configured.
|
|
||||||
This is odd because the test suite goes to some lengths to
|
|
||||||
get env vars set to prevent this problem.
|
|
||||||
* `git annex assistant` has not been tested, is probably quite incomplete
|
* `git annex assistant` has not been tested, is probably quite incomplete
|
||||||
and/or buggy.
|
and/or buggy.
|
||||||
* Doesn't daemonize. Maybe use
|
* Doesn't daemonize. Maybe use
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue