On Fri, Sep 06, 2019 at 02:13:26PM +0200, SZEDER Gábor wrote:

> Once upon a time GIT_TEST_HTTPD was a tristate variable and we
> exported 'GIT_TEST_HTTPD=YesPlease' in our CI scripts to make sure
> that we run the httpd tests in the Linux Clang and GCC build jobs, or
> error out if they can't be run for any reason [1].

Yikes, good catch.

I wonder if it would be possible for the test suite to catch this. I
think env--helper would have written a message to stderr, but because we
use --exit-code, we can't tell the difference between that and "false".

I think we'd have go back to something more like:

  test_tristate () {
        bool=$(git env--helper --type=bool --default=true "$1") ||
                eval "error \"$1 is not a bool: \$$1\""
        test "$bool" = "true"
  }
  ...
  if test_tristate GIT_TEST_HTTPD
  then
        ... use httpd ...
  fi

Not sure if it's worth it.

-Peff

Reply via email to