Skip to content
Snippets Groups Projects
  1. May 03, 2020
  2. Nov 20, 2017
  3. Nov 02, 2017
  4. Dec 31, 2015
  5. Aug 31, 2014
  6. Nov 04, 2012
    • David M. Carr's avatar
      tests: use fn_git_commit in test-encoding.t · 24d47416
      David M. Carr authored
      In c4849b2dab87, the "commit" function was extracted into a testutil for re-use.
      However, test-encoding.t was skipped over in that changeset, as I was seeing
      unexplained test failures.  Since those test failures have now been explained
      (and fixed), this changeset performs the same extraction on test-encoding.t as
      was done on all the other tests.
      
      The version of fn_git_commit that was used in testutil redirected all output
      (including errors) to /dev/null, which didn't match the expectations of this
      test.  The test utility functions for commit/tag now no longer throw away error
      output, instead leaving it to individual tests to decide if error output should
      be ignored.
      24d47416
  7. Nov 03, 2012
    • David M. Carr's avatar
      tests: extract git command-line client and dulwich requirements into testutil · 675f19af
      David M. Carr authored
      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.
      675f19af
  8. Oct 31, 2012
    • David M. Carr's avatar
      tests: extract commonly used commit/tag functions into testutil library · c4849b2d
      David M. Carr authored
      Thanks to Felipe Contreras for the patch which this was based on.
      
      The functions were renamed to make it clearer that these are shell functions
      rather than normal git/hg commands, and to make it clearer which tool is being
      invoked.
      
      Old name | New name
      ------------------------
      commit   | fn_git_commit
      tag      | fn_git_tag
      hgcommit | fn_hg_commit
      hgtag    | fn_hg_tag
      
      Extraction from test-encoding.t was left for a subsequent patch, as I was seeing
      unexpected output changes when I attempted the extraction.
      
      The gitcommit and hgcommit functions in test-bookmark-workflow.t were left
      as-is for now, as they have a different behavior than the standard version
      (separate counters for each).
      c4849b2d
    • David M. Carr's avatar
      tests: extract extension configuration into a testutil library · a7da97e6
      David M. Carr authored
      Thanks to Felipe Contreras for the patch which this was based on.
      
      Even though the MQ extension was only used in a single test
      (test-pull-after-strip.t), I included it in the testutil.  It shouldn't hurt
      anything to have it enabled and not used, and saves us from having to deal
      with enabling extensions in individual tests at all.
      
      Similarly, this changeset results in the graphlog extension being enabled
      for all tests, even though there were some that didn't use it before.  This is
      even less significant in Mercurial 2.3+, since in those versions, graphlog is
      part of core, and is available even when the extension is disabled.
      a7da97e6
Loading