aboutsummaryrefslogtreecommitdiff
path: root/Test.hs
Commit message (Collapse)AuthorAge
* Dial back optimisation when building on armGravatar Joey Hess2018-03-04
| | | | | | | | | | | | | | | | | | | | | Prevent ghc and llc from running out of memory when optimising some files. Sean Whitton reported that doing this only in Test.hs was insufficient, the build still OOMed by the time it got to Test.hs. He had earlier found the build worked when these options are applied globally. See https://ghc.haskell.org/trac/ghc/ticket/14821 for why it needs -O1; once that's fixed it may suffice to use "GHC-Options: -O2 -optlo-O2", although it may also be that the -O1 prevents ghc from using/leaking as much memory. os(arm) should match armel, armhf, armeb, and arm. It probably also matches arm64, somewhat unfortunately since arm64 systems probably tend to have more memory. See list of arches in https://hackage.haskell.org/package/Cabal-1.22.2.0/docs/src/Distribution-System.html This commit was sponsored by Henrik Riomar on Patreon.
* Split Test.hs and avoid optimising it much, to need less memory to compile.Gravatar Joey Hess2018-02-18
| | | | | | | | The ghc options were found by Sean Whitton; the debian arm autobuilders need those to build w/o OOM, and it seems to involve llvm using too much memory to optimize Test. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
* finally really add back custom-setup stanzaGravatar Joey Hess2017-12-31
| | | | | | | | | | | | Fourth or fifth try at this and finally found a way to make it work. Absurd amount of busy-work forced on me by change in cabal's behavior. Split up Utility modules that need posix stuff out of ones used by Setup. Various other hacks around inability for Setup to use anything that ifdefs a use of unix. Probably lost a full day of my life to this. This is how build systems make their users hate them. Just saying.
* Revert "git-annex.cabal: Add back custom-setup stanza, so cabal new-build ↵Gravatar Joey Hess2017-12-31
| | | | | | | | | | | works." This reverts commit c7c745d28868c8cd646d3e31dd8ba6a0b763f611. No, still doesn't work when built with cabal. It did with stack; stack must somehow make the unix package implicitly available. With cabal, System.Posix.Process and System.Posix.Env are both missing.
* git-annex.cabal: Add back custom-setup stanza, so cabal new-build works.Gravatar Joey Hess2017-12-31
| | | | | | | | Seems I had all the work in past commits to make this build, at least on linux. I'm actually surprised it does, without a unix dep, Utility.Env still builds ok somehow despite using System.Posix.Env. This commit was sponsored by Fernando Jimenez on Patreon.
* Removed the testsuite build flagGravatar Joey Hess2017-12-20
| | | | | | | | | | Test suite is always included. Building with this flag disabled has actually been broken for some time, since Command.TestRemote uses tasty. Fewer build flags are better, so good time to drop it. This commit was sponsored by Thomas Hochstein on Patreon.
* fold Build/SysConfig.hs into BuildInfo via includeGravatar Joey Hess2017-12-14
| | | | | | | | | | | This avoids warnings from stack about the module not being listed in the cabal file. So, the generated file is also renamed to Build/SysConfig. Note that the setup program seems to be cached despite these changes; I had to cabal clean to get cabal to update it so that Build/SysConfig was written. This commit was sponsored by Jochen Bartl on Patreon.
* .noannex fileGravatar Joey Hess2017-12-13
| | | | | | | | | | | | | A top-level .noannex file will prevent git-annex init from being used in a repository. This is useful for repositories that have a policy reason not to use git-annex. The content of the file will be displayed to the user who tries to run git-annex init. This also affects git annex reinit and initialization via the webapp. It does not affect automatic inits, when there's a sibling git-annex branch already. This commit was supported by the NSF-funded DataLad project.
* try again to avoid directory removal issues on NFSGravatar Joey Hess2017-12-05
| | | | | | | | | | | 6c4c1a9bccfaa94525f343153b179c2170293686 seems to not have worked; though the keys database should not have any files open after closeDb, NFS seems to be creating some files where while the directory is being removed, which causes the removal to fail. So instead, try renaming the directory out of the way. This commit was supported by the NSF-funded DataLad project.
* still can't express custom-setup depsGravatar Joey Hess2017-11-14
| | | | | | | | They need unix on non-windows, for Utility.Env, which Build.Configure uses, but cabal can't express that in a custom-setup stanza. To avoid this problem, Utility.Env would need to be moved into unix-compat..
* split out setEnv to avoid adding depGravatar Joey Hess2017-11-14
| | | | | | | | | | | Windows needs the setenv package in custom-setup, but I don't want to pull it in on unix, which would probably break some builds and need more work. Instead, split out setEnv to a separate module. Quite likely, unix-compat will get a portable environment layer, and then both modules can be removed from here. This commit was sponsored by Øyvind Andersen Holm.
* avoid build warning on windowsGravatar Joey Hess2017-10-24
|
* fix process and FD leakGravatar Joey Hess2017-09-29
| | | | | | | | | | | | | Fix process and file descriptor leak that was exposed when git-annex was built with ghc 8.2.1. Apparently ghc has changed its behavior of GC of open file handles that are pipes to running processes. That broke git-annex test on OSX due to running out of FDs. Audited for all uses of Annex.new and made stopCoProcesses be called once it's done with the state. Fixed several places that might have leaked in other situations than running the test suite. This commit was sponsored by Ewen McNeill.
* test: Fix reversion that made it only run inside a git repository.Gravatar Joey Hess2017-09-29
| | | | | | | | Using annexeval to run probeCrippledFileSystem' caused Git.CurrentRepo.get to be run. Fixed easily since probeCrippledFileSystem' had no need to use the Annex monad. This commit was sponsored by Ethan Aubin.
* init: Display an additional message when it detects a filesystem that allows ↵Gravatar Joey Hess2017-08-28
| | | | writing to files whose write bit is not set.
* add annex-ignore-command and annex-sync-command configsGravatar Joey Hess2017-08-17
| | | | | | | | | | | | | | | | Added remote configuration settings annex-ignore-command and annex-sync-command, which are dynamic equivilants of the annex-ignore and annex-sync configurations. For this I needed a new DynamicConfig infrastructure. Its implementation should be as fast as before when there is no dynamic config, and it caches so shell commands are only run once. Note that annex-ignore-command exits nonzero when the remote should be ignored. While that may seem backwards, it allows using the same command for it as for annex-sync-command when you want to disable both. This commit was sponsored by Trenton Cronholm on Patreon.
* test: Avoid most situations involving failure to delete test directoriesGravatar Joey Hess2017-08-14
| | | | | | | | | | | | | | | | | | | By forking a worker process and only deleting the test directory once it exits. This way, if a test leaves files open, they'll get closed when the worker exits, so avoiding failure to delete open files on Windows, and failure to delete directories due to NFS lock files. If a test leaves a git worker process running, the closed pipes should cause the worker to exit too, also avoiding the problem there. The 10 second sleep ought to give plenty of time for such worker processes to exit, although this is of course a race. Finally, even if test directory fails to be deleted still, it won't appear as if the last test in the test suite failed; the error will be displayed at the very end. This commit was supported by the NSF-funded DataLad project.
* Fix a git-annex test failure when run on NFS due to NFS lock files ↵Gravatar Joey Hess2017-08-14
| | | | | | | | | | | | | preventing directory removal. Should fix this: lock (v6 --force): FAIL Exception: .git/annex/keys: removeDirectoryRecursive: unsatisfied constraints (Directory not empty) Verified that the test case still catches the regression it's meant to. This commit was supported by the NSF-funded DataLad project.
* Added GIT_ANNEX_VECTOR_CLOCK environment variableGravatar Joey Hess2017-08-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Can be used to override the default timestamps used in log files in the git-annex branch. This is a dangerous environment variable; use with caution. Note that this only affects writing to the logs on the git-annex branch. It is not used for metadata in git commits (other env vars can be set for that). There are many other places where timestamps are still used, that don't get committed to git, but do touch disk. Including regular timestamps of files, and timestamps embedded in some files in .git/annex/, including the last fsck timestamp and timestamps in transfer log files. A good way to find such things in git-annex is to get for getPOSIXTime and getCurrentTime, although some of the results are of course false positives that never hit disk (unless git-annex gets swapped out..) So this commit does NOT necessarily make git-annex comply with some HIPPA privacy regulations; it's up to the user to determine if they can use it in a way compliant with such regulations. Benchmarking: It takes 0.00114 milliseconds to call getEnv "GIT_ANNEX_VECTOR_CLOCK" when that env var is not set. So, 100 thousand log files can be written with an added overhead of only 0.114 seconds. That should be by far swamped by the actual overhead of writing the log files and making the commit containing them. This commit was supported by the NSF-funded DataLad project.
* fix failing quickcheck propertiesGravatar Joey Hess2017-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QuickCheck 2.10 found a counterexample eg "\929184" broke the property. As far as I can tell, Git.Filename is matching how git handles encoding of strange high unicode characters in filenames for display. Git does not display high unicode characters, and instead displays the C-style escaped form of each byte. This is ambiguous, but since git is not unicode aware, it doesn't need to roundtrip parse it. So, making Git.FileName's roundtrip test only chars < 256 seems fine. Utility.Format.format uses encode_c, in order to mimic git, so that's ok. Utility.Format.gen uses decode_c, but only so that stuff like "\n" in the format string is handled. If the format string contains C-style octal escapes, they will be converted to ascii characters, and not combined into unicode characters, but that should not be a problem. If the user wants unicode characters, they can include them in the format string, without escaping them. Finally, decode_c is used by Utility.Gpg.secretKeys, because gpg --with-colons hex-escapes some characters in particular ':' and '\\'. gpg passes unicode through, so this use of decode_c is not a problem. This commit was sponsored by Henrik Riomar on Patreon.
* fix test suite breakage caused by GIT_ANNEX_USE_GIT_SSHGravatar Joey Hess2017-04-07
|
* improve git-annex-shell exit status propigationGravatar Joey Hess2017-03-20
|
* test move with ssh remoteGravatar Joey Hess2017-03-17
|
* test suite infra for testing mocked ssh remotesGravatar Joey Hess2017-03-17
| | | | This commit was supported by the NSF-funded DataLad project.
* add KeyVariety typeGravatar Joey Hess2017-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Where before the "name" of a key and a backend was a string, this makes it a concrete data type. This is groundwork for allowing some varieties of keys to be disabled in file2key, so git-annex won't use them at all. Benchmarks ran in my big repo: old git-annex info: real 0m3.338s user 0m3.124s sys 0m0.244s new git-annex info: real 0m3.216s user 0m3.024s sys 0m0.220s new git-annex find: real 0m7.138s user 0m6.924s sys 0m0.252s old git-annex find: real 0m7.433s user 0m7.240s sys 0m0.232s Surprising result; I'd have expected it to be slower since it now parses all the key varieties. But, the parser is very simple and perhaps sharing KeyVarieties uses less memory or something like that. This commit was supported by the NSF-funded DataLad project.
* factor non-type stuff out of KeyGravatar Joey Hess2017-02-24
|
* correct spelling mistakesGravatar Edward Betts2017-02-12
|
* import: Changed how --deduplicate, --skip-duplicates, and --clean-duplicates ↵Gravatar Joey Hess2017-02-07
| | | | | | | | | | | | | | | | | | | | | determine if a file is a duplicate Before, only content known to be present somewhere was considered a duplicate. Now, any content that has been annexed before will be considered a duplicate, even if all annexed copies of the data have been lost. Note that --clean-duplicates and --deduplicate still check numcopies, so won't delete duplicate files unless there's an annexed copy. This makes import use the same method as reinject --known. The man page already said that duplicate meant "its content is either present in the local repository already, or git-annex knows of another repository that contains it, or it was present in the annex before but has been removed now". So, this is really only bringing the implementation into line with the man page. This commit was sponsored by Jochen Bartl on Patreon.
* Always use filesystem encoding for all file and handle reads and writes.Gravatar Joey Hess2016-12-24
| | | | | This is a big scary change. I have convinced myself it should be safe. I hope!
* lock: Fix edge cases where data loss could occur in v6 mode.Gravatar Joey Hess2016-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where the pointer file is in place, and not the content of the object, lock's performNew was called with filemodified=True, which caused it to try to repopulate the object from an unmodified associated file, of which there were none. So, the content of the object got thrown away incorrectly. This was the cause (although not the root cause) of data loss in https://github.com/datalad/datalad/issues/1020 The same problem could also occur when the work tree file is modified, but the object is not, and lock is called with --force. Added a test case for this, since it's excercising the same code path and is easier to set up than the problem above. Note that this only occurred when the keys database did not have an inode cache recorded for the annex object. Normally, the annex object would be in there, but there are of course circumstances where the inode cache is out of sync with reality, since it's only a cache. Fixed by checking if the object is unmodified; if so we don't need to try to repopulate it. This does add an additional checksum to the unlock path, but it's already checksumming the worktree file in another case, so it doesn't slow it down overall. Further investigation found a similar problem occurred when smudge --clean is called on a file and the inode cache is not populated. cleanOldKeys deleted the unmodified old object file in this case. This was also fixed by checking if the object is unmodified. In general, use of getInodeCaches and sameInodeCache is potentially dangerous if the inode cache has not gotten populated for some reason. Better to use isUnmodified. I breifly auited other places that check the inode cache, and did not see any immediate problems, but it would be easy to miss this kind of problem.
* add test case for sync_in_adjusted_branch_deleted_recently_added_filesGravatar Joey Hess2016-10-11
| | | | This commit was sponsored by Denis Dzyubenko on Patreon.
* squelch build warning on windowsGravatar Joey Hess2016-09-06
|
* Removed dependency on json library; all JSON is now handled by aeson.Gravatar Joey Hess2016-07-26
| | | | | I've eyeballed all --json commands, and the only difference should be that some fields are re-ordered.
* uninit: Fix crash due to trying to write to deleted keys db.Gravatar Joey Hess2016-07-12
| | | | | | Reversion introduced by v6 mode support, affects v5 too. Also fix a similar crash when the webapp is used to delete a repository.
* add test case for ↵Gravatar Joey Hess2016-06-13
| | | | http://git-annex.branchable.com/bugs/Assistant_keeps_deleting_all_the_files_in_my_repo/
* reproducedGravatar Joey Hess2016-06-13
|
* update test suite for lock/unlock with missing file content change in v6Gravatar Joey Hess2016-06-09
|
* better failure diagnosisGravatar Joey Hess2016-06-03
|
* plumb RemoteGitConfig through to decryptCipherGravatar Joey Hess2016-05-23
|
* fix recent test suite reversionGravatar Joey Hess2016-05-23
| | | | | | git annex adjust --force will overwrite any current adjusted branch. I didn't document this because for the user, deleting the branch is just as good.
* fix test suite breakageGravatar Joey Hess2016-05-23
|
* adjusted branches need git 2.2.0 or newerGravatar Joey Hess2016-04-22
| | | | | | When git-annex is used with a git version older than 2.2.0, disable support for adjusted branches, since GIT_COMMON_DIR is needed to update them and was first added in that version of git.
* use a separate tmp dir for the test homeGravatar Joey Hess2016-04-20
|
* a couple of tests chdir in ways that need an absolute path in the overridden ↵Gravatar Joey Hess2016-04-20
| | | | HOME
* Isolate test suite from global git config settings.Gravatar Joey Hess2016-04-20
|
* add simple test for conflict resolution in adjusted branchGravatar Joey Hess2016-04-12
| | | | This is not really extensive enough, but a start..
* don't assume git-annex is in path when calling itself from test suiteGravatar Joey Hess2016-02-16
|
* 100% pass on FATGravatar Joey Hess2016-02-16
|
* fix numerous problem with test suite on crippled filesystems etcGravatar Joey Hess2016-02-16
|
* avoid fromkey test when on crippled fsGravatar Joey Hess2016-02-15
|