Commit graph

89 commits

Author SHA1 Message Date
Joey Hess
a05ac13e92 fix metadata log simplifier and additional quickcheck tests 2014-02-12 22:27:55 -04:00
Joey Hess
1b79d18a40 data types and serialization for metadata
A very haskell commit! Just data types, instances to serialize the metadata
to a nice format, and QuickCheck tests.

This commit was sponsored by Andreas Leha.
2014-02-12 17:57:32 -04:00
Joey Hess
40cec65ace more hlint 2014-02-11 10:48:52 -04:00
Joey Hess
e8b9c96e4e
use nukefile rather than shelling to rm 2014-02-10 18:29:15 -04:00
Joey Hess
ae2bc90a1d eliminating absNormPath
git-annex has been using MissingH's `abdNormPath` forever, but that's
unmaintained and possibly buggy, and doesn't work on Windows. I've been
wanting to get rid of it for some time, and finally did today, writing a
`simplifyPath` that does the things git-annex needs and will work with all
the Windows filename craziness, and takes advantage of the more modern
System.FilePath to be quite a simple peice of code. A QuickCheck test found
no important divergences from absNormPath. A good first step to making
git-annex not depend on MissingH at all.

And it fixed some weird behaviors on Windows like
`git annex add ..\subdir\file` not working.

Note that absNormPathUnix has been left alone for now.
2014-02-07 17:15:18 -04:00
Joey Hess
dc3b7effd2 add regression test for symlink calculation
Note: Test reordered because running git-annex sync early broke the
environment for some other tests.
2014-02-06 20:57:58 -04:00
Joey Hess
751f496c11 add test case & fix conflict resolution bug on Windows & FAT
Fix bug in automatic merge conflict resolution code when used
on a filesystem not supporting symlinks, which resulted in it losing
track of the symlink bit of annexed files.

This was the underlying bug that was causing another test to fail,
which got worked around in 1c997fd08c.
I've chosen to keep 2 separate test cases since the old test case only
detected the problem accidentially.

Test suite passes on FAT & in windows, as well as on proper unix systems.

This commit was sponsored by Ellis Whitehead.
2014-02-04 17:24:12 -04:00
Joey Hess
88003c446b narrowing test case 2014-02-04 15:27:49 -04:00
Joey Hess
8e81a7e906 add test case for windows sync push failure
This adds a test for a failure mode seemingly specific to Windows
that was removed in 1c997fd08c, and puts it
in its own test case.
2014-02-04 14:50:28 -04:00
Joey Hess
5d7777cbe2 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.
2014-02-04 14:31:52 -04:00
Joey Hess
617c63a213 fix broken test
1c997fd08c broke the mixed conflict
resolution test. Since origin is no longer involved, both sides have to
sync after pairing. (The sync before pairing is just to get a commit.)
2014-02-03 14:32:07 -04:00
Joey Hess
c91bbc9494 fix reversion on repo deletion
A broken symlink would cause the mode setting to fail.
2014-02-03 14:20:39 -04:00
Joey Hess
ec417b108d improve failure message 2014-02-03 12:23:05 -04:00
Joey Hess
1c997fd08c fix test suite to pass on windows
On windows, the sync of the second cloned repo to origin failed, because
synced/master was a non-fast-forward. This may be a bug of its own, but
it's not the issue that this test was intended to test, so disconnect
the repos from origin before syncing.
2014-02-03 12:12:50 -04:00
Joey Hess
ecd9b6731e try harder to delete test dir on windows 2014-02-03 11:45:31 -04:00
Joey Hess
29bb04aa0d Windows: Fix deletion of repositories by test suite and webapp.
On Windows, a file that is not writable cannot be deleted even if in a
directory with write perms. So git object files were not getting deleted
when removing a git repository.
2014-02-03 11:19:41 -04:00
Joey Hess
1669e80e85 Windows: Avoid using unix-compat's rename, which refuses to rename directories.
Opened a bug about this: https://github.com/jystic/unix-compat/issues/10
2014-01-29 15:19:03 -04:00
Joey Hess
998d76ae04 Revert "temporarily revert tasty-rerun support for this release"
This reverts commit 8fcf041159.
2014-01-27 14:22:44 -04:00
Joey Hess
8fcf041159 temporarily revert tasty-rerun support for this release
revert c340d9506c

tasty-rerun is stuck in NEW in debian
2014-01-27 13:58:43 -04:00
Joey Hess
74b101d1dd reorg 2014-01-26 16:36:31 -04:00
Joey Hess
86ffeb73d1 reorganize some files and imports 2014-01-26 16:25:55 -04:00
Joey Hess
c340d9506c tasty-rerun! make rerest runs much much faster than running whole test suite 2014-01-24 12:21:30 -04:00
Joey Hess
ae3cd632bd add timestamps to unused log files
This will be used in expiring old unused objects. The timestamp is when it
was first noticed it was unused.

Backwards compatability: It supports reading old format unused log files.
The old version of git-annex will ignore lines in log files written by the
new version, so the worst interop problem would be git annex dropunused not
knowing some numbers that git-annex unused reported.
2014-01-22 15:33:02 -04:00
Joey Hess
e38a21a768 tests should now all run independently, without needing any prior tests to have run
Should be ready now for tasty-rerun.
2014-01-21 14:26:13 -04:00
Joey Hess
4a4e2f9a6c use tasty resources 2014-01-21 14:04:50 -04:00
Joey Hess
d1bf61464f expose tasty test suite's option parser 2014-01-21 00:08:43 -04:00
Joey Hess
d66535f065 global numcopies setting
* numcopies: New command, sets global numcopies value that is seen by all
  clones of a repository.
* The annex.numcopies git config setting is deprecated. Once the numcopies
  command is used to set the global number of copies, any annex.numcopies
  git configs will be ignored.
* assistant: Make the prefs page set the global numcopies.

This global numcopies setting is needed to let preferred content
expressions operate on numcopies.

It's also convenient, because typically if you want git-annex to preserve N
copies of files in a repo, you want it to do that no matter which repo it's
running in. Making it global avoids needing to warn the user about gotchas
involving inconsistent annex.numcopies settings.
(See changes to doc/numcopies.mdwn.)

Added a new variety of git-annex branch log file, that holds only 1 value.
Will probably be useful for other stuff later.

This commit was sponsored by Nicolas Pouillard.
2014-01-20 16:47:56 -04:00
Joey Hess
7e311a00d0 Fix typo in test suite. 2013-12-24 14:02:02 -04:00
Joey Hess
cee4c9a11d Fix test suite to cover lock --force change. 2013-12-15 13:33:09 -04:00
Joey Hess
bc0517fc86 test direct mode first (it breaks more often) 2013-11-26 17:05:13 -04:00
Joey Hess
7323770d8a run each quickcheck test 1000, rather than 100 times
I've had one or two fails sent to me involving cases QuickCheck didh't
easily find, and tasty makes this easy.
2013-11-15 17:04:40 -04:00
Joey Hess
27fb2b6126 add test case for b0f85b3e22 2013-11-15 15:42:31 -04:00
Joey Hess
238fa05545 tasty fully working 2013-11-14 20:09:47 -04:00
Joey Hess
cf93636df8 finished converting test suite for tasty
Also merged in Test.hs from master.
2013-11-14 17:03:49 -04:00
Joey Hess
8189738b13 test suite partially converted to use tasty test framework
This is a win. Will need to wait for tasty getting into Debian,
and do a trivial conversion of the remainder of the hunit tests.
2013-08-06 00:12:06 -04:00
Joey Hess
fc96861084 enable 2 more tests on Windows 2013-08-04 13:54:05 -04:00
Joey Hess
38022f4f49 Windows: Fixed permissions problem that prevented removing files from directory special remote.
Directory special remotes now fully usable.
2013-08-04 13:43:48 -04:00
Joey Hess
6a97896b47 missed some __WINDOWS__ defines 2013-08-04 13:07:55 -04:00
Joey Hess
f59a2f8e82 regression test for 7b0970b340 2013-07-30 17:04:05 -04:00
Joey Hess
147a9f8882 Improve test suite on Windows; now tests git annex sync. 2013-07-30 17:03:32 -04:00
Joey Hess
6ac595f8b5 update test suite for dropunused behavior change 2013-07-30 14:17:09 -04:00
Joey Hess
f353f13c9d Support unannex and uninit in direct mode.
In direct mode, it's best to whenever possible not move direct mode files
out of the way, and so I made unannex avoid touching the direct mode file at
all.

That actually turns out to be easy, because in direct mode, unlike indirect
mode, the pre-commit hook won't get confused if the unannexed file later
gets added back by git add. So there's no need to commit the unannex right
away; it can be staged for the user to commit later. This also means that
unannex in direct mode is a lot faster than in indirect mode!

Another subtle bit is the bookkeeping that is done when unannexing a direct
mode file. The inode cache needs to be removed so that when uninit runs
getKeysPresent, it doesn't see the cache and think the key is still
present and crash when it's not.

This commit is sponsored by Douglas Butts. Thanks!
2013-07-22 17:28:53 -04:00
Joey Hess
8661dba587 adjust test suite for changed dropunused behavior with bogus numbers 2013-07-09 14:46:20 -04:00
Joey Hess
bab49ac7c6 few final bits for fully working test suite on windows 2013-06-18 16:37:54 -04:00
Joey Hess
8b3427c52e Windows: The test suite now passes on Windows (a few broken parts are disabled).
Better to have a working test suite that doesn't test a few things
than no working test suite.

Most of the disabled stuff is because for some reason "git annex sync"
doesn't work when run inside the test suite. Looks like PATH problems.

The directory and rsync special remotes seem broken on Windows, or
maybe the tests are. Pretty sure the hook special remote test is broken.
2013-06-18 16:16:25 -04:00
Joey Hess
55f971de3c disable a test that windows git doesn't support 2013-06-18 15:21:13 -04:00
Joey Hess
4e28e84baf more slash fixes 2013-06-18 15:15:00 -04:00
Joey Hess
8063d68b02 couple path separator fixes 2013-06-18 14:08:35 -04:00
Joey Hess
6ac3d33445 allow test temp dir removal to fail (working around some problem on Windows) 2013-06-18 13:41:33 -04:00
Joey Hess
09edbd5df2 some basic tests of preferred content expressions and standard groups 2013-05-25 13:51:36 -04:00