git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Prathamesh Chavan <pc44800@gmail.com>
To: Jon Loeliger <jdl@jdl.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] t2027: avoid using pipes
Date: Thu, 9 Mar 2017 03:43:18 +0530	[thread overview]
Message-ID: <CAME+mvV__RT5fbSBRU_SwP69xC-JuBE5bmfRbw91VN36-ToxZA@mail.gmail.com> (raw)
In-Reply-To: <CAME+mvWVDPT+-F7Z-O=XR_EN4qeNEoQ5ksLpLVkVBb0O9LKROg@mail.gmail.com>

But when I read the function carefully, it only removes the trash files created
when test_failure is equal to zero. But as far as I know, I can see the files
being removed even when a test_failure is non-zero for some test script.

On Thu, Mar 9, 2017 at 3:08 AM, Prathamesh Chavan <pc44800@gmail.com> wrote:
> Whenever a test suite is executed, after finishing every test, after running
> all tests, the function test_done is called. You may find this function in
> test-lib.sh . This function displays the result of the test and also removes
> the trash created by running the test.
>
> On Wed, Mar 8, 2017 at 9:14 PM, Jon Loeliger <jdl@jdl.com> wrote:
>> So, like, Prathamesh Chavan said:
>>> The exit code of the upstream of a pipe is ignored thus we should avoid
>>> using it. By writing out the output of the git command to a file, we
>>> can test the exit codes of both the commands.
>>>
>>> Signed-off-by: Prathamesh <pc44800@gmail.com>
>>> ---
>>>  t/t2027-worktree-list.sh | 14 +++++++-------
>>>  1 file changed, 7 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/t/t2027-worktree-list.sh b/t/t2027-worktree-list.sh
>>> index 848da5f..daa7a04 100755
>>> --- a/t/t2027-worktree-list.sh
>>> +++ b/t/t2027-worktree-list.sh
>>> @@ -31,7 +31,7 @@ test_expect_success '"list" all worktrees from main' '
>>>       test_when_finished "rm -rf here && git worktree prune" &&
>>>       git worktree add --detach here master &&
>>>       echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short
>>> HEAD) (detached HEAD)" >>expect &&
>>> -     git worktree list | sed "s/  */ /g" >actual &&
>>> +     git worktree list >out && sed "s/  */ /g" <out >actual &&
>>>       test_cmp expect actual
>>>  '
>>
>> I confess I am not familiar with the test set up.
>> However, I'd ask the question do we care about the
>> lingering "out" and "actual" files here?  Or will
>> they silently be cleaned up along the way later?
>>
>> Thanks,
>> jdl

  reply	other threads:[~2017-03-08 22:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 15:13 [PATCH] t2027: avoid using pipes Prathamesh Chavan
2017-03-08 15:44 ` Jon Loeliger
2017-03-08 21:38   ` Prathamesh Chavan
2017-03-08 22:13     ` Prathamesh Chavan [this message]
2017-03-09  8:08 ` Christian Couder
2017-03-09  8:56   ` Prathamesh Chavan
2017-03-09  9:39 ` [PATCH v2] " Prathamesh Chavan
2017-03-09  9:53   ` Prathamesh Chavan
2017-03-09 12:30     ` Christian Couder
2017-03-09 19:18       ` [PATCH] " Prathamesh Chavan
2017-03-10 13:34       ` [PATCH v2] " Prathamesh Chavan
  -- strict thread matches above, loose matches on Subject: below --
2017-03-09 19:03 [PATCH] " Prathamesh Chavan
2017-03-09 20:15 ` Christian Couder

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=CAME+mvV__RT5fbSBRU_SwP69xC-JuBE5bmfRbw91VN36-ToxZA@mail.gmail.com \
    --to=pc44800@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jdl@jdl.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).