git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, "David Turner" <novalis@novalis.org>,
	"Elijah Newren" <newren@gmail.com>,
	"Matheus Tavares" <matheus.bernardino@usp.br>,
	"Jeff King" <peff@peff.net>,
	"Derrick Stolee" <derrickstolee@github.com>,
	"Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Subject: Re: test-lib.sh musings: test_expect_failure considered harmful
Date: Tue, 12 Oct 2021 09:45:19 -0700	[thread overview]
Message-ID: <xmqq4k9m6vkw.fsf@gitster.g> (raw)
In-Reply-To: <87tuhmk19c.fsf@evledraar.gmail.com> (=?utf-8?B?IsOGdmFyIEFy?= =?utf-8?B?bmZqw7Zyw7A=?= Bjarmason"'s message of "Tue, 12 Oct 2021 11:23:40 +0200")

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Mon, Oct 11 2021, Junio C Hamano wrote:
>
> [Removed "In-reply-to: <xmqq5yu3b80j.fsf@gitster.g>" with the Subject
> change]

Please do not do the former, although it is welcome to change Subject.

> Presumably with test_expect_failure.
>
> I'll change it, in this case we'd end up with a test_expect_success at
> the end, so it doesn't matter much & I don't care.

I do agree with you that compared to expect_success, which requires
_all_ steps to succeed, so an failure in any of its steps is
immediately noticeable, it is harder to write and keep
expect_failure useful, because it is not like we are happy to see
any failure in any step.  We do not expect a failure in many
preparation and conclusion steps in the &&-chain in expect_failure
block, and we consider it is an error if these steps fail.  We only
want to mark only a single step to exhibit an expected but undesirable
behaviour.

But even with the shortcomings of expect_failure, it still is much
better than claiming that we expect a bogus outcome.

Improving the shortcomings of expect_failure would be a much better
use of our time than advocating an abuse of expect_sucess, I would
think.

  reply	other threads:[~2021-10-12 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12  9:23 test-lib.sh musings: test_expect_failure considered harmful Ævar Arnfjörð Bjarmason
2021-10-12 16:45 ` Junio C Hamano [this message]
2021-10-13 10:10   ` Ævar Arnfjörð Bjarmason
2021-10-13 13:05   ` Derrick Stolee
2021-10-13 17:16     ` Junio C Hamano
2021-10-14 17:11       ` Ævar Arnfjörð Bjarmason

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=xmqq4k9m6vkw.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=matheus.bernardino@usp.br \
    --cc=newren@gmail.com \
    --cc=novalis@novalis.org \
    --cc=peff@peff.net \
    /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;
as well as URLs for NNTP newsgroup(s).