git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Johannes Sixt <j6t@kdbg.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Allow "git shortlog" to group by committer information
Date: Wed, 21 Dec 2016 12:44:25 -0800	[thread overview]
Message-ID: <xmqqh95xhv12.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20161221032221.s7jmgnfrr6tyuyuk@sigill.intra.peff.net> (Jeff King's message of "Tue, 20 Dec 2016 22:22:21 -0500")

Jeff King <peff@peff.net> writes:

> I do wonder if in general it should be the responsibility of skippable
> tests to make sure we end up with the same state whether they are run or
> not. That might manage the complexity more. But I certainly don't mind
> tests being defensive like you have here.

If we speak "in general", I would say that any test should be
prepared to be turned into a skippable one, and they should all make
sure they leave the same state whether they are skipped, they
succeed, or they fail in the middle.

That can theoretically be achievable (e.g. you assume you would
always start from an empty repository, do your thing and arrange to
leave an empty repository by doing test_when_finished), and the
cognitive cost of developers to do so can be reduced by teaching
test_expect_{success/failure} helpers to be responsible for the
"arrange to leave an empty repository" part.  But it is quite a big
departure from the way our tests are currently done, i.e. prepare
the environment once and then each of multiple tests observes one
thing in that environment (e.g. "does it work well with --dry-run?
how about without?").

Also it will make the runtime cost of the tests a lot larger, as
setup and teardown need to happen for each individual test.  So I do
not think it is a good goal in practice.

Perhaps what you suggest may be a good middle-ground.  When you add
prerequisite to an existing test, it will become your responsibility
to make sure the test will leave the same state.  That way, you
would know that tests that come later will not be affected by your
change.


      parent reply	other threads:[~2016-12-21 20:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-11 18:45 Allow "git shortlog" to group by committer information Linus Torvalds
2016-10-11 19:01 ` Jeff King
2016-10-11 19:07   ` Linus Torvalds
2016-10-11 19:17     ` Jeff King
2016-12-15 21:29 ` Linus Torvalds
2016-12-16  0:19   ` Junio C Hamano
2016-12-16  1:39     ` Linus Torvalds
2016-12-16  4:56       ` Junio C Hamano
2016-12-16  1:45     ` [PATCH 1/1] " Linus Torvalds
2016-12-16  1:51     ` Stephen & Linda Smith
2016-12-16  2:00       ` Linus Torvalds
2016-12-16 13:39   ` Jeff King
2016-12-16 13:51     ` Jeff King
2016-12-16 17:27       ` Junio C Hamano
2016-12-20 18:12       ` Johannes Sixt
2016-12-20 18:19         ` Junio C Hamano
2016-12-20 18:24           ` Junio C Hamano
2016-12-20 18:35             ` Junio C Hamano
2016-12-20 18:52               ` Johannes Sixt
2016-12-21 21:09                 ` Johannes Sixt
2016-12-21  3:22               ` Jeff King
2016-12-21  7:55                 ` Jacob Keller
2016-12-21 16:04                   ` Jeff King
2016-12-21 20:44                 ` Junio C Hamano [this message]

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=xmqqh95xhv12.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=peff@peff.net \
    --cc=torvalds@linux-foundation.org \
    /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).