• J
    tests: turn on network daemon tests by default · 83d842dc
    Jeff King 提交于
    We do not run the httpd nor git-daemon tests by default, as
    they are rather heavyweight and require network access
    (albeit over localhost). However, it would be nice if more
    pepole ran them, for two reasons:
    
      1. We would get more test coverage on more systems.
    
      2. The point of the test suite is to find regressions. It
         is very easy to change some of the underlying code and
         break the httpd code without realizing you are even
         affecting it. Running the httpd tests helps find these
         problems sooner (ideally before the patches even hit
         the list).
    
    We still want to leave an "out", though, for people who really do
    not want to run them. For that reason, the GIT_TEST_HTTPD and
    GIT_TEST_GIT_DAEMON variables are now tri-state booleans
    (true/false/auto), so you can say GIT_TEST_HTTPD=false to turn the
    tests back off.  To support those who want a stable single way to
    disable these tests across versions of Git before and after this
    change, an empty string explicitly set to these variables is also
    taken as "false", so the behaviour changes only for those who:
    
      a. did not express any preference by leaving these variables
         unset.  They did not test these features before, but now they
         do; or
    
      b. did express that they want to test these features by setting
         GIT_TEST_FEATURE=false (or any equivalent other ways to tell
         "false" to Git, e.g. "0"), which has been a valid but funny way
         to say that they do want to test the feature only because we
         used to interpret any non-empty string to mean "yes please
         test".  They no longer test that feature.
    
    In addition, we are forgiving of common setup failures (e.g., you do
    not have apache installed, or have an old version) when the
    tri-state is "auto" (or unset), but report an error when it is
    "true". This makes "auto" a sane default, as we should not cause
    failures on setups where the tests cannot run. But it allows people
    who use "true" to catch regressions in their system (e.g., they
    uninstalled apache, but were expecting their automated test runs to
    test git-httpd, and would want to be notified).
    Signed-off-by: NJeff King <peff@peff.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    83d842dc
lib-httpd.sh 6.0 KB