git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Duy Nguyen <pclouds@gmail.com>, Git Mailing List <git@vger.kernel.org>
Subject: Re: t7405.17 breakage vanishes with GETTEXT_POISON=1
Date: Mon, 29 Oct 2018 12:36:55 +0900	[thread overview]
Message-ID: <xmqqzhux77ag.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20181028121517.GO30222@szeder.dev> ("SZEDER =?utf-8?Q?G?= =?utf-8?Q?=C3=A1bor=22's?= message of "Sun, 28 Oct 2018 13:15:17 +0100")

SZEDER Gábor <szeder.dev@gmail.com> writes:

> The test in question runs
>
>   test_i18ngrep ! "refusing to lose untracked file at" err
>
> which fails in normal test runs, because 'grep' does find the
> undesired string; that's the known breakage.  Under GETTEXT_POISION,
> however, 'test_i18ngrep' always succeeds because of this condition:
>
>   if test -n "$GETTEXT_POISON"
>   then
>           # pretend success
>           return 0
>   fi
>
> and then in turn the whole test succeeds.

Ah, good spotting.

If a test using "grep" declares that something must not exist in
plumbing message, it writes "! grep something", and because
"test_i18ngrep something" always pretends that something is found
under poisoned build (by the way, would this change when we remove
the separate poisoned build?), "test_i18ngrep ! something" must be
used for Porcelain messages to say the same thing.

Of course, this has a funny interactions with test_expect_failure.
I actually do not think the complexity to work this around is worth
it.  

Changing behaviour of "test_i18ngrep ! something" to always fail
under poisoned build would not work, of course, and changing it to
always fail under poisoned build inside test_expect_failure would
not be a good idea, either, because the know breakage may be at
steps in the same test that is different from the grep, e.g., we may
have a "git dothis" command that should keep the HEAD without
emitting an error message, and we may test it like so:

	git rev-parse HEAD >old &&
	git dothis >out 2>err &&
	test_i18ngrep ! error: err && # no error should be seen
	git rev-parse HEAD >new &&
	test_cmp old new

but currently the command may have a known bug that it moves HEAD;
the command however does not emit an error message.

SO...

  reply	other threads:[~2018-10-29  3:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-28  5:41 t7405.17 breakage vanishes with GETTEXT_POISON=1 Duy Nguyen
2018-10-28 12:15 ` SZEDER Gábor
2018-10-29  3:36   ` Junio C Hamano [this message]
2018-10-29 16:19   ` Duy Nguyen

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

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

  git send-email \
    --in-reply-to=xmqqzhux77ag.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=szeder.dev@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.
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 NNTP newsgroup(s).