git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: t7405.17 breakage vanishes with GETTEXT_POISON=1

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 29, 2018, 03:36 UTC
Message-ID
<xmqqzhux77ag.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20181028121517.GO30222@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 15 quoted lines
> 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...
Previous: SZEDER GáborNext: Duy Nguyen
Message 3 of 4 in “t7405.17 breakage vanishes with GETTEXT_POISON=1”
  1. Duy NguyenOct 28, 2018
  2. SZEDER GáborOct 28, 2018
  3. Junio C HamanoOct 29, 2018
  4. Duy NguyenOct 29, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.