git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Michael J Gruber <git@grubix.eu>,
	Lars Schneider <larsxschneider@gmail.com>
Subject: Re: [PATCH] tests: fix tests broken under GETTEXT_POISON=YesPlease
Date: Sun, 23 Apr 2017 18:15:57 -0700	[thread overview]
Message-ID: <xmqq1ssi4nci.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170421185757.28978-1-avarab@gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Fri, 21 Apr 2017 18:57:57 +0000")

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> The GETTEXT_POISON=YesPlease compile-time testing option added in my
> bb946bba76 ("i18n: add GETTEXT_POISON to simulate unfriendly
> translator", 2011-02-22) has been slowly bitrotting as strings have
> been marked for translation, and new tests have been added without
> running it.
>
> I brought this up on the list ("[BUG] test suite broken with
> GETTEXT_POISON=YesPlease", [1]) asking whether this mode was useful at
> all anymore. At least one person occasionally uses it, and Lars
> Schneider offered to change one of the the Travis builds to run in
> this mode, so fix up the failing ones.
>
> My test setup runs most of the tests, with the notable exception of
> skipping all the p4 tests, so it's possible that there's still some
> lurking regressions I haven't fixed.
>
> 1. <CACBZZX62+acvi1dpkknadTL827mtCm_QesGSZ=6+UnyeMpg8+Q@mail.gmail.com>

To be honest, I feel quite uneasy about this patch.  It is no
brainer to take fixes like the one to 1309 where we used grep on a
localizable string to use test_i18ngrep instead---they are obviously
good changes.

But changes that skip tests with !GETTEXT_POISON look suspicious.

> diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh
> index 8937e25e49..2003ec7907 100755
> --- a/t/t1430-bad-ref-name.sh
> +++ b/t/t1430-bad-ref-name.sh
> @@ -122,7 +122,7 @@ test_expect_success 'push cannot create a badly named ref' '
>  	! grep -e "broken\.\.\.ref" output
>  '
>  
> -test_expect_failure 'push --mirror can delete badly named ref' '
> +test_expect_failure !GETTEXT_POISON 'push --mirror can delete badly named ref' '
>  	top=$(pwd) &&
>  	git init src &&
>  	git init dest &&

This test affects only src and dest repositories that does not seem
to be looked at by later tests, so skipping it is presumably safe.

I am guessing that the reason why this is skipped is because the
error message is looked at with "! grep ", not "grep", but by
skipping the entire test, we are not checking that "push" succeeds
(which should happen regardless of the locale).

It also is VERY curious that the test before this one (whose tail is
visible in the pre-context) does not need to be skipped.  Is that
because we can expect "broken...ref", which is litrally a part of a
refname, would be emitted intact in any locale (including the
poisoned one)?  If that is the case it is curous why this one needs
to be skipped.

> diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
> index 5778c0afe1..a428ae6703 100755
> --- a/t/t3203-branch-output.sh
> +++ b/t/t3203-branch-output.sh
> @@ -236,7 +236,7 @@ test_expect_success 'git branch --format option' '
>  	Refname is refs/heads/ref-to-remote
>  	EOF
>  	git branch --format="Refname is %(refname)" >actual &&
> -	test_cmp expect actual
> +	test_i18ncmp expect actual
>  '

This is a strange change.  Filling the placeholder in a format
string "Refname is %(refname)" should be affeced by i18n???

> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index 33d392ba11..e07d6d8cd2 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -366,7 +366,7 @@ test_expect_success 'verbose flag is heeded, even after --
> ...
> -test_expect_success 'multi-squash only fires up editor once' '
> +test_expect_success !GETTEXT_POISON 'multi-squash only fires up editor once' '
>  	base=$(git rev-parse HEAD~4) &&
>  	set_fake_editor &&
>  	FAKE_COMMIT_AMEND="ONCE" FAKE_LINES="1 squash 2 squash 3 squash 4" \

This is also curious.  Is this because the poison locale does not substitute
anything passed to format template and literal strings like ONCE and
the instructions do not reach the edited file?

 (skipping many changes, not because I find nothing to comment on them)

> diff --git a/t/t5316-pack-delta-depth.sh b/t/t5316-pack-delta-depth.sh
> index 37143ea0ac..2ed479b712 100755
> --- a/t/t5316-pack-delta-depth.sh
> +++ b/t/t5316-pack-delta-depth.sh
> @@ -82,12 +82,16 @@ test_expect_success 'packing produces a long delta' '
>  	# Use --window=0 to make sure we are seeing reused deltas,
>  	# not computing a new long chain.
>  	pack=$(git pack-objects --all --window=0 </dev/null pack) &&
> -	test 9 = "$(max_chain pack-$pack.pack)"
> +	echo 9 >expect &&
> +	max_chain pack-$pack.pack >actual &&
> +	test_i18ncmp expect actual
>  '

This is also curious.  Why do we needto protect comparision with a
line whose contents is '9' from poison locale?  If the last one were
test_cmp I think this is a good change, by the way.

>  test_expect_success '--depth limits depth' '
>  	pack=$(git pack-objects --all --depth=5 </dev/null pack) &&
> -	test 5 = "$(max_chain pack-$pack.pack)"
> +	echo 5 >expect &&
> +	max_chain pack-$pack.pack >actual &&
> +	test_i18ncmp expect actual
>  '

Likewise.


  reply	other threads:[~2017-04-24  1:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 21:58 [BUG] test suite broken with GETTEXT_POISON=YesPlease Ævar Arnfjörð Bjarmason
2017-04-21 14:47 ` Michael J Gruber
2017-04-21 17:28   ` Ævar Arnfjörð Bjarmason
2017-04-24  1:18   ` Junio C Hamano
     [not found]     ` <20170424110434.27689-1-avarab@gmail.com>
2017-04-26  9:17       ` [PATCH] tests: remove the GETTEXT_POISON compile-time option to test i18n marking Michael J Gruber
2017-04-26 14:27         ` Ævar Arnfjörð Bjarmason
2017-04-21 14:54 ` [BUG] test suite broken with GETTEXT_POISON=YesPlease Lars Schneider
2017-04-21 18:05   ` Ævar Arnfjörð Bjarmason
2017-04-21 18:57   ` [PATCH] tests: fix tests broken under GETTEXT_POISON=YesPlease Ævar Arnfjörð Bjarmason
2017-04-24  1:15     ` Junio C Hamano [this message]
2017-04-24  8:18       ` Ævar Arnfjörð Bjarmason
2017-04-25  4:11         ` Junio C Hamano
2017-04-25  8:56           ` Ævar Arnfjörð Bjarmason
2017-04-26  1:58             ` Junio C Hamano
2017-04-26  7:56               ` Ævar Arnfjörð Bjarmason
2017-04-24 13:22   ` [BUG] test suite broken with GETTEXT_POISON=YesPlease Duy Nguyen
2017-04-24 20:37     ` Jeff King
2017-04-25  8:51       ` Lars Schneider
2017-04-25 10:01         ` Jeff King
2017-04-28  8:42           ` Lars Schneider
2017-04-28  8:44             ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1ssi4nci.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@grubix.eu \
    --cc=git@vger.kernel.org \
    --cc=larsxschneider@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).