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

Re: [RFC/PATCH] test: skip clean-up when running under --immediate mode

From
Jeff King <peff@peff.net>
Date
Jun 28, 2011, 22:51 UTC
Message-ID
<20110628225147.GD4192@sigill.intra.peff.net>
In-Reply-To
<7vmxh3xidt.fsf@alter.siamese.dyndns.org>
On Mon, Jun 27, 2011 at 11:02:22AM -0700, Junio C Hamano wrote:
Show 26 quoted lines
> Some tests try to be too careful about cleaning themselves up and
> do
> 
>     test_expect_success description '
>         set-up some test refs and/or configuration &&
>         test_when_finished "revert the above changes" &&
> 	the real test
>     '
> 
> Which is nice to make sure that a potential failure would not have
> unexpected interaction with the next test. This however interferes when
> "the real test" fails and we want to see what is going on, by running the
> test with --immediate mode and descending into its trash directory after
> the test stops. The precondition to run the real test and cause it to fail
> is all gone after the clean-up procedure defined by test_when_finished is
> done.
> 
> Update test_run_ which is the workhorse of running a test script
> called from test_expect_success and test_expect_failure, so that we do not
> run clean-up script defined with test_when_finished when a test that is
> expected to succeed fails under the --immediate mode.
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> 
>  * Likes, dislikes?

This sounds to me like the right thing to do. The current behavior has never been a problem for me, but that is probably because test_when_finished is relatively new. If I were to run into this situation, your patch does exactly what I would expect.

-Peff
Previous: Junio C HamanoNext: Michael J Gruber
Message 2 of 4 in “test: skip clean-up when running under --immediate mode”
  1. test: skip clean-up when running under --immediate modeJunio C Hamano, Jun 27, 2011
  2. Jeff KingJun 28, 2011
  3. Michael J GruberJun 30, 2011
  4. Sverre RabbelierJul 1, 2011

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.