Re: [PATCH v2 1/2] t5411: use different out file to prevent overwriting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SZEDER Gábor <szeder.dev@xxxxxxxxx> 于2021年1月20日周三 下午8:49写道:
>
> Would it be possible/desirable to die gracefully when the receiving
> end doesn't support push options?

If want to die gracefully, we need to end the pack protocol by sending
a flush packet, close the connection. However, since we can easily fix
this test case, I think changes for git protocol is unnecessary.

> > diff --git a/t/t5411/test-0000-standard-git-push.sh b/t/t5411/test-0000-standard-git-push.sh
> > index 47b058af7e..b074417d4b 100644
> > --- a/t/t5411/test-0000-standard-git-push.sh
> > +++ b/t/t5411/test-0000-standard-git-push.sh
> > @@ -35,11 +35,11 @@ test_expect_success "git-push --atomic ($PROTOCOL)" '
> >       test_must_fail git -C workbench push --atomic origin \
> >               main \
> >               $B:refs/heads/next \
> > -             >out 2>&1 &&
> > +             >out-0000-1 2>&1 &&
> >       filter_out_user_friendly_and_stable_output \
> >               -e "/^To / { p; }" \
> >               -e "/^ ! / { p; }" \
> > -             <out >actual &&
> > +             <out-0000-1 >actual &&
> >       cat >expect <<-EOF &&
> >       To <URL/of/upstream.git>
> >        ! [rejected] main -> main (non-fast-forward)
> > @@ -65,8 +65,8 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
> >               push origin \
> >               main \
> >               $B:refs/heads/next \
> > -             >out 2>&1 &&
> > -     make_user_friendly_and_stable_output <out >actual &&
> > +             >out-0000-2 2>&1 &&
> > +     make_user_friendly_and_stable_output <out-0000-2 >actual &&
>
> There will be a lot of sequential numbers this way, which might lead
> to additional churn in the future, if we ever were to add more tests
> somewhere in the middle.  However, our test framework does already
> have a counter for test cases, so we could perhaps use that, i.e.
> 'out-$test_count', to make sure that each test case has its own output
> file.

Using $test_count is better, and will do.

Thanks.
--
Jiang Xin




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux