tests: extract git command-line client and dulwich requirements into testutil
One or both of these requirements were in almost every test in exactly the same way. Now, these checks are performed in every test that uses the testutil. This makes it easier for test authors to add these checks into new tests (just add a reference to the testutil, which you'd probably want anyway). We considered having each test declare their requirements (currently, either "git" or "dulwich"), but in this case, preferred the simplicity of having the check always performed (even if a particular test doesn't need one or the other). You can't perform any meaningful testing of Hg-Git without both of these dependencies properly configured. The main value to checking for them in the tests (rather than just letting the tests fail) is that it gives a meaningful error message to help people figure out how to fix their environment. In the case that either git or dulwich is missing, the information will be just as clearly conveyed regardless of whether its all the tests that are skipped, or just most of them. I didn't add dulwich to hghave (even though this is clearly the sort of thing that hghave is intended for) because hghave is currently pulled from Mercurial completely unchanged, and it's probably best to keep it that way. Tested by running the tests in three configurations: * No dulwich installed (ran 0, skipped 28, failed 0, output: Skipped *: missing feature: dulwich) * Bad git on path (ran 1, skipped 27, failed 0, output: Skipped *: missing feature: git command line client) * Working git and correct version of dulwich installed (ran 28, skipped 0, failed 0) Thanks to Felipe Contreras for the idea to extract this logic into a library.
Showing
- tests/test-bookmark-workflow.t 0 additions, 6 deletionstests/test-bookmark-workflow.t
- tests/test-clone.t 0 additions, 6 deletionstests/test-clone.t
- tests/test-conflict-1.t 0 additions, 6 deletionstests/test-conflict-1.t
- tests/test-conflict-2.t 0 additions, 6 deletionstests/test-conflict-2.t
- tests/test-convergedmerge.t 0 additions, 6 deletionstests/test-convergedmerge.t
- tests/test-empty-working-tree.t 0 additions, 6 deletionstests/test-empty-working-tree.t
- tests/test-encoding.t 0 additions, 6 deletionstests/test-encoding.t
- tests/test-file-removal.t 0 additions, 6 deletionstests/test-file-removal.t
- tests/test-git-clone.t 0 additions, 6 deletionstests/test-git-clone.t
- tests/test-git-submodules.t 0 additions, 6 deletionstests/test-git-submodules.t
- tests/test-git-tags.t 0 additions, 6 deletionstests/test-git-tags.t
- tests/test-git-workflow.t 0 additions, 6 deletionstests/test-git-workflow.t
- tests/test-hg-author.t 0 additions, 6 deletionstests/test-hg-author.t
- tests/test-hg-branch.t 0 additions, 6 deletionstests/test-hg-branch.t
- tests/test-hg-tags.t 0 additions, 6 deletionstests/test-hg-tags.t
- tests/test-incoming.t 0 additions, 6 deletionstests/test-incoming.t
- tests/test-keywords.t 0 additions, 6 deletionstests/test-keywords.t
- tests/test-merge.t 0 additions, 6 deletionstests/test-merge.t
- tests/test-octopus.t 0 additions, 6 deletionstests/test-octopus.t
- tests/test-outgoing.t 0 additions, 6 deletionstests/test-outgoing.t
Loading
Please register or sign in to comment