From 9e230cd448cf4168bbb2aad2e3b863637c02b075 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 8 Aug 2019 13:28:04 -0400 Subject: [PATCH] work around adjusted unlocked branch problem in test suite --- Test.hs | 10 ++++++++ ...indows_export_tree_exports_empty_tree.mdwn | 24 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 doc/bugs/windows_export_tree_exports_empty_tree.mdwn diff --git a/Test.hs b/Test.hs index d9fdca9951..8e16f50b2e 100644 --- a/Test.hs +++ b/Test.hs @@ -1738,6 +1738,11 @@ test_export_import = intmpclonerepoInDirect $ do git_annex "get" [] @? "get of files failed" annexed_present annexedfile + -- When on an adjusted branch, this updates the master branch + -- to match it, which is necessary since the master branch is going + -- to be exported. + git_annex "sync" [] @? "sync failed" + git_annex "export" ["master", "--to", "foo"] @? "export to dir failed" dircontains annexedfile (content annexedfile) @@ -1793,6 +1798,11 @@ test_export_import_subdir = intmpclonerepoInDirect $ do @? "git mv failed" boolSystem "git" [Param "commit", Param "-m", Param "moved"] @? "git commit failed" + + -- When on an adjusted branch, this updates the master branch + -- to match it, which is necessary since the master branch is going + -- to be exported. + git_annex "sync" [] @? "sync failed" -- Run three times because there was a bug that took a couple -- of runs to lead to the wrong tree being written to the remote diff --git a/doc/bugs/windows_export_tree_exports_empty_tree.mdwn b/doc/bugs/windows_export_tree_exports_empty_tree.mdwn new file mode 100644 index 0000000000..45af8f600c --- /dev/null +++ b/doc/bugs/windows_export_tree_exports_empty_tree.mdwn @@ -0,0 +1,24 @@ +The test suite's `test_export_import` fails on Windows. +It seems that exporting a tree that contains annexed files +somehow ends up exporting an empty tree. + +The test is running in an adjusted unlocked branch. But it exports +the master branch. The master branch indeed contains an empty tree. + +The origin repo is also using an adjusted unlocked branch. Some changes +have been committed there, but not synced back to the master branch. + +On clone from that, git-annex sets up an adjusted unlocked branch, +and it merges origin's adjusted unlocked branch in. So the annexed files +are present in that branch, but still not in master. + +This is not really a windows-specific problem. Only on windows or perhaps +on a crippled FS does the test suite actually test opeation in an unlocked +adjusted branch, because it enters that mode only on demand. Arguably +the test suite should run all the tests separately on an adjusted branch, +but that would add a lot of extra time to the test suite and very few +tests are likely to behave any differently there. + +On balance, I think that making the test case run a git-annex sync +before exporting is good enough. +--[[Joey]]