git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>,
	git@vger.kernel.org,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>
Subject: [PATCH 1/4] t0000: keep clean-up tests together
Date: Thu, 19 Nov 2020 19:17:23 -0500	[thread overview]
Message-ID: <20201120001723.GA307112@coredump.intra.peff.net> (raw)
In-Reply-To: <20201120001458.GA274082@coredump.intra.peff.net>

We check that test_when_finished cleans up after a test, and that it
runs even after a failure. Those two were originally adjacent, but got
split apart by the new test added in 477dcaddb6 (tests: do not let lazy
prereqs inside `test_expect_*` turn off tracing, 2020-03-26), and then
further by more lazy-prereq tests. Let's move them back together.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t0000-basic.sh | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index f4ba2e8c85..d49b5dd4ac 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -829,17 +829,6 @@ then
 	exit 1
 fi
 
-clean=no
-test_expect_success 'tests clean up after themselves' '
-	test_when_finished clean=yes
-'
-
-if test -z "$GIT_TEST_FAIL_PREREQS_INTERNAL" -a $clean != yes
-then
-	say "bug in test framework: basic cleanup command does not work reliably"
-	exit 1
-fi
-
 test_lazy_prereq NESTED_INNER '
 	>inner &&
 	rm -f outer
@@ -874,6 +863,17 @@ test_expect_success 'lazy prereqs do not turn off tracing' "
 	grep 'echo trace' lazy-prereq-and-tracing/err
 "
 
+clean=no
+test_expect_success 'tests clean up after themselves' '
+	test_when_finished clean=yes
+'
+
+if test -z "$GIT_TEST_FAIL_PREREQS_INTERNAL" -a $clean != yes
+then
+	say "bug in test framework: basic cleanup command does not work reliably"
+	exit 1
+fi
+
 test_expect_success 'tests clean up even on failures' "
 	run_sub_test_lib_test_err \
 		failing-cleanup 'Failing tests with cleanup commands' <<-\\EOF &&
-- 
2.29.2.730.g3e418f96ba


  reply	other threads:[~2020-11-20  0:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 19:04 [PATCH 1/2] tests: make sure nested lazy prereqs work reliably SZEDER Gábor
2020-11-18 19:04 ` [PATCH 2/2] tests: fix description of 'test_set_prereq' SZEDER Gábor
2020-11-18 20:00 ` [PATCH 1/2] tests: make sure nested lazy prereqs work reliably Junio C Hamano
2020-11-19 15:58 ` Jeff King
2020-11-19 17:56   ` Jeff King
2020-11-19 19:50     ` Junio C Hamano
2020-11-20  0:14       ` Jeff King
2020-11-20  0:17         ` Jeff King [this message]
2020-11-20  0:20         ` [PATCH 2/4] t0000: run prereq tests inside sub-test Jeff King
2020-11-20  0:22         ` [PATCH 3/4] t0000: run cleaning test " Jeff King
2020-11-20  0:27         ` [PATCH 4/4] t0000: consistently use single quotes for outer tests Jeff King
2020-11-20  1:32         ` [PATCH 1/2] tests: make sure nested lazy prereqs work reliably Junio C Hamano
2020-11-20  0:07   ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2021-01-28  6:32 [PATCH 0/4] t0000 cleanups Jeff King
2021-01-28  6:32 ` [PATCH 1/4] t0000: keep clean-up tests together 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=20201120001723.GA307112@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --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.
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).