git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jacob Keller <jacob.keller@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git mailing list <git@vger.kernel.org>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCHv5 2/8] t7408: merge short tests, factor out testing method
Date: Tue, 23 Aug 2016 15:10:23 -0700	[thread overview]
Message-ID: <CA+P7+xrmsNBxmoR6+2C9ZVvXcVH7D+O3iYqKhVrbAsaNUXzF_A@mail.gmail.com> (raw)
In-Reply-To: <20160815215327.15682-3-sbeller@google.com>

On Mon, Aug 15, 2016 at 2:53 PM, Stefan Beller <sbeller@google.com> wrote:
> Tests consisting of one line each can be consolidated to have fewer tests
> to run as well as fewer lines of code.
>
> When having just a few git commands, do not create a new shell but
> use the -C flag in Git to execute in the correct directory.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---

Looks good. The resulting test file is easier to read, and you created
a common function to perform checking if we used alternates instead of
duplicating that part multiple times.

>  t/t7408-submodule-reference.sh | 48 ++++++++++++++++++++++--------------------
>  1 file changed, 25 insertions(+), 23 deletions(-)
>
> diff --git a/t/t7408-submodule-reference.sh b/t/t7408-submodule-reference.sh
> index b84c6748..dff47af 100755
> --- a/t/t7408-submodule-reference.sh
> +++ b/t/t7408-submodule-reference.sh
> @@ -8,6 +8,15 @@ test_description='test clone --reference'
>
>  base_dir=$(pwd)
>
> +test_alternate_is_used () {
> +       alternates_file="$1" &&
> +       working_dir="$2" &&
> +       test_line_count = 1 "$alternates_file" &&
> +       echo "0 objects, 0 kilobytes" >expect &&
> +       git -C "$working_dir" count-objects >actual &&
> +       test_cmp expect actual
> +}
> +

This change wasn't mentioned in the description. You updated the tests
to use a stronger check for when alternates is in use. This is good. I
might have mentioned it in the description but it's not worth a
re-roll.

> -test_expect_success 'that reference gets used with update' '
> -       cd super-clone/sub &&
> -       echo "0 objects, 0 kilobytes" >expected &&
> -       git count-objects >current &&
> -       diff expected current

The stronger variant was used once here, but you use it in several
locations. It's good to have extracted this as the new tests are more
readable.

Thanks,
Jake

  reply	other threads:[~2016-08-23 22:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 21:53 [PATCHv5 0/8] git clone: Marry --recursive and --reference Stefan Beller
2016-08-15 21:53 ` [PATCHv5 1/8] t7408: modernize style Stefan Beller
2016-08-23 22:04   ` Jacob Keller
2016-08-15 21:53 ` [PATCHv5 2/8] t7408: merge short tests, factor out testing method Stefan Beller
2016-08-23 22:10   ` Jacob Keller [this message]
2016-08-15 21:53 ` [PATCHv5 3/8] submodule--helper module-clone: allow multiple references Stefan Beller
2016-08-23 22:12   ` Jacob Keller
2016-08-15 21:53 ` [PATCHv5 4/8] submodule--helper update-clone: " Stefan Beller
2016-08-23 22:20   ` Jacob Keller
2016-08-15 21:53 ` [PATCHv5 5/8] clone: factor out checking for an alternate path Stefan Beller
2016-08-23 22:29   ` Jacob Keller
2016-08-15 21:53 ` [PATCHv5 6/8] clone: clarify option_reference as required Stefan Beller
2016-08-23 22:31   ` Jacob Keller
2016-08-15 21:53 ` [PATCHv5 7/8] clone: implement optional references Stefan Beller
2016-08-23 22:35   ` Jacob Keller
2016-08-15 21:53 ` [PATCHv5 8/8] clone: recursive and reference option triggers submodule alternates Stefan Beller
2016-08-23 22:43   ` Jacob Keller
2016-08-23 23:03     ` Stefan Beller
2016-08-24  6:29       ` Jacob Keller
2016-08-24 22:52         ` Stefan Beller
2016-08-24 23:37           ` Jacob Keller
2016-08-31  5:04             ` Stefan Beller
2016-08-31  6:21               ` Jacob Keller
2016-08-15 22:30 ` [PATCHv5 0/8] git clone: Marry --recursive and --reference Junio C Hamano

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=CA+P7+xrmsNBxmoR6+2C9ZVvXcVH7D+O3iYqKhVrbAsaNUXzF_A@mail.gmail.com \
    --to=jacob.keller@gmail.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=sbeller@google.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).