1
0
mirror of https://github.com/git/git.git synced 2024-09-21 10:52:56 +02:00
git/ci
Ævar Arnfjörð Bjarmason 1ff750b128 tests: make GIT_TEST_GETTEXT_POISON a boolean
Change the GIT_TEST_GETTEXT_POISON variable from being "non-empty?" to
being a more standard boolean variable.

Since it needed to be checked in both C code and shellscript (via test
-n) it was one of the remaining shellscript-like variables. Now that
we have "env--helper" we can change that.

There's a couple of tricky edge cases that arise because we're using
git_env_bool() early, and the config-reading "env--helper".

If GIT_TEST_GETTEXT_POISON is set to an invalid value die_bad_number()
will die, but to do so it would usually call gettext(). Let's detect
the special case of GIT_TEST_GETTEXT_POISON and always emit that
message in the C locale, lest we infinitely loop.

As seen in the updated tests in t0017-env-helper.sh there's also a
caveat related to "env--helper" needing to read the config for trace2
purposes.

Since the C_LOCALE_OUTPUT prerequisite is lazy and relies on
"env--helper" we could get invalid results if we failed to read the
config (e.g. because we'd loop on includes) when combined with
e.g. "test_i18ngrep" wanting to check with "env--helper" if
GIT_TEST_GETTEXT_POISON was true or not.

I'm crossing my fingers and hoping that a test similar to the one I
removed in the earlier "config tests: simplify include cycle test"
change in this series won't happen again, and testing for this
explicitly in "env--helper"'s own tests.

This change breaks existing uses of
e.g. GIT_TEST_GETTEXT_POISON=YesPlease, which we've documented in
po/README and other places. As noted in [1] we might want to consider
also accepting "YesPlease" in "env--helper" as a special-case.

But as the lack of uproar over 6cdccfce1e ("i18n: make GETTEXT_POISON
a runtime option", 2018-11-08) demonstrates the audience for this
option is a really narrow set of git developers, who shouldn't have
much trouble modifying their test scripts, so I think it's better to
deal with that minor headache now and make all the relevant GIT_TEST_*
variables boolean in the same way than carry the "YesPlease"
special-case forward.

1. https://public-inbox.org/git/xmqqtvckm3h8.fsf@gitster-ct.c.googlers.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-21 09:42:49 -07:00
..
util travis-ci: include the trash directories of failed tests in the trace log 2018-08-01 09:59:36 -07:00
install-dependencies.sh Merge branch 'sg/ci-libsvn-perl' 2019-05-19 16:45:31 +09:00
lib.sh tests: make GIT_TEST_GETTEXT_POISON a boolean 2019-06-21 09:42:49 -07:00
make-test-artifacts.sh ci: parallelize testing on Windows 2019-01-29 09:26:47 -08:00
mount-fileshare.sh Add a build definition for Azure DevOps 2019-01-29 09:26:46 -08:00
print-test-failures.sh ci/lib.sh: add support for Azure Pipelines 2019-01-29 09:26:46 -08:00
run-build-and-tests.sh Merge branch 'js/vsts-ci' 2019-02-06 22:05:26 -08:00
run-linux32-build.sh Merge branch 'js/vsts-ci' 2019-02-06 22:05:26 -08:00
run-linux32-docker.sh ci: rename the library of common functions 2019-01-28 10:34:28 -08:00
run-static-analysis.sh ci: inherit --jobs via MAKEFLAGS in run-build-and-tests 2019-01-28 10:34:28 -08:00
run-test-slice.sh ci: parallelize testing on Windows 2019-01-29 09:26:47 -08:00
test-documentation.sh ci: fix AsciiDoc/Asciidoctor stderr check in the documentation build job 2019-04-05 14:41:16 +09:00