Git development
 help / color / mirror / Atom feed
From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Karthik Nayak <karthik.188@gmail.com>, git@vger.kernel.org
Cc: gitster@pobox.com
Subject: Re: [PATCH v2 04/20] t9300: make the series S tests self-contained
Date: Thu, 19 Nov 2026 23:57:10 +0530	[thread overview]
Message-ID: <a9916667-f53b-4611-892a-047728c22f53@gmail.com> (raw)
In-Reply-To: <20261112-kn-fast-import-tests-1-v2-4-b8c3a0ab27e8@gmail.com>

On 11/12/26 23:04, Karthik Nayak wrote:
> Similar to the previous commits, modify the tests in 'series S' to make
> them independent of state from previous tests.
> 
> Replace the 'S: initialize for S tests' test with a
> 'setup_marks_repo()' function, so each test can invoke it to setup its
> own repo and tear it down when the test completes.
> 
> 'S: from with garbage after mark must fail' used to create the 'S2'
> commit which 'S: merge with garbage after mark must fail' needs. Create
> that commit in the merge test instead.
> 
> Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
> ---
>   t/t9300-fast-import.sh | 332 +++++++++++++++++++++++++++++--------------------
>   1 file changed, 198 insertions(+), 134 deletions(-)
> 
> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
> index a0e322b866..f9359bbaf3 100755
> --- a/t/t9300-fast-import.sh
> +++ b/t/t9300-fast-import.sh
> @@ -3100,10 +3100,12 @@ test_expect_success 'R: --git-completion-helper-all does not read from stdin' '
>   #
>   #   invalid dataref ..
>   #
> -test_expect_success 'S: initialize for S tests' '
> +setup_marks_repo () {
> +	test_when_finished "rm -rf repo" &&
> +	git init repo &&
>   	test_tick &&
>   
> -	cat >input <<-INPUT_END &&
> +	cat >repo/input <<-INPUT_END &&
>   	commit refs/heads/S
>   	mark :301
>   	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
> @@ -3140,142 +3142,168 @@ test_expect_success 'S: initialize for S tests' '
>   	BLOB
>   	INPUT_END
>   
> -	git fast-import --export-marks=marks <input
> -'
> +	git -C repo fast-import --export-marks=marks <repo/input
> +}
>   

Ok. So, the setup needed for the 'S' series is a bit more involved and 
it was done once initially before all tests. So, turning this into a 
function and calling it from every place that needs it makes sense.

The rest of the patch looks good just as the commit describes it to be.

-- 
Sivaraam


  reply	other threads:[~2026-11-19 18:27 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 11:49 [PATCH 00/20] t9300: group and move tests to other files Karthik Nayak
2026-11-10 11:49 ` [PATCH 01/20] t9300: move 'fastimport.unpackLimit' to the required test Karthik Nayak
2026-11-10 11:49 ` [PATCH 02/20] t9300: make the series B tests self-contained Karthik Nayak
2026-11-10 11:49 ` [PATCH 03/20] t9300: make the series T " Karthik Nayak
2026-11-10 11:49 ` [PATCH 04/20] t9300: make the series S " Karthik Nayak
2026-11-10 11:49 ` [PATCH 05/20] t9300: make the series V " Karthik Nayak
2026-11-10 11:49 ` [PATCH 06/20] t9300: make the series Q " Karthik Nayak
2026-11-10 11:49 ` [PATCH 07/20] t9300: make the series P " Karthik Nayak
2026-11-10 11:49 ` [PATCH 08/20] t9300: make the series O " Karthik Nayak
2026-11-10 11:49 ` [PATCH 09/20] t9300: make the big blob " Karthik Nayak
2026-11-10 11:49 ` [PATCH 10/20] t9300: make the ref update " Karthik Nayak
2026-11-10 11:49 ` [PATCH 11/20] t9300: make the date format " Karthik Nayak
2026-11-10 11:49 ` [PATCH 12/20] t9300: make the pack edges test self-contained Karthik Nayak
2026-11-10 11:49 ` [PATCH 13/20] t9300: make the marks tests self-contained Karthik Nayak
2026-11-10 11:49 ` [PATCH 14/20] t9300: make the series Y " Karthik Nayak
2026-11-10 11:50 ` [PATCH 15/20] t9300: make the cat-blob " Karthik Nayak
2026-11-10 11:50 ` [PATCH 16/20] t9300: make the feature and option " Karthik Nayak
2026-11-10 11:50 ` [PATCH 17/20] t9300: make the stream " Karthik Nayak
2026-11-10 11:50 ` [PATCH 18/20] t9300: make the get-mark and encoding " Karthik Nayak
2026-11-10 11:50 ` [PATCH 19/20] t9300: move self-contained tests into dedicated files Karthik Nayak
2026-11-10 11:50 ` [PATCH 20/20] t93xx: drop the series letter from the moved test names Karthik Nayak
2026-11-10 16:45 ` [PATCH 00/20] t9300: group and move tests to other files Junio C Hamano
2026-11-10 20:06   ` Junio C Hamano
2026-11-11 11:22     ` Karthik Nayak
2026-11-12 17:34 ` [PATCH v2 " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 01/20] t9300: move 'fastimport.unpackLimit' to the required test Karthik Nayak
2026-11-19 10:06     ` Kaartic Sivaraam
2026-11-12 17:34   ` [PATCH v2 02/20] t9300: make the series B tests self-contained Karthik Nayak
2026-11-19 12:22     ` Kaartic Sivaraam
2026-11-12 17:34   ` [PATCH v2 03/20] t9300: make the series T " Karthik Nayak
2026-11-19 12:45     ` Kaartic Sivaraam
2026-11-12 17:34   ` [PATCH v2 04/20] t9300: make the series S " Karthik Nayak
2026-11-19 18:27     ` Kaartic Sivaraam [this message]
2026-11-12 17:34   ` [PATCH v2 05/20] t9300: make the series V " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 06/20] t9300: make the series Q " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 07/20] t9300: make the series P " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 08/20] t9300: make the series O " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 09/20] t9300: make the big blob " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 10/20] t9300: make the ref update " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 11/20] t9300: make the date format " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 12/20] t9300: make the pack edges test self-contained Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 13/20] t9300: make the marks tests self-contained Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 14/20] t9300: make the series Y " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 15/20] t9300: make the cat-blob " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 16/20] t9300: make the feature and option " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 17/20] t9300: make the stream " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 18/20] t9300: make the get-mark and encoding " Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 19/20] t9300: move self-contained tests into dedicated files Karthik Nayak
2026-11-12 17:34   ` [PATCH v2 20/20] t93xx: drop the series letter from the moved test names Karthik Nayak

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=a9916667-f53b-4611-892a-047728c22f53@gmail.com \
    --to=kaartic.sivaraam@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@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