From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Michael J Gruber <git@grubix.eu>, git@vger.kernel.org
Subject: Re: [BUG/WIP PATCH] unit-tests: use clean test environment
Date: Mon, 03 Mar 2025 06:07:29 -0800 [thread overview]
Message-ID: <xmqqzfi2xl5q.fsf@gitster.g> (raw)
In-Reply-To: <Z8WFcaEtMCD5C0EN@pks.im> (Patrick Steinhardt's message of "Mon, 3 Mar 2025 11:33:21 +0100")
Patrick Steinhardt <ps@pks.im> writes:
> Maybe. I guess for unit tests it's a lot less clear cut as most of the
> tests won't depend on such a controlled environment. So sanitizing the
> environment would be a good enough first step for me, and if we see
> demand for making specific information available to lots of tests we
> could still start to expose those at a later point.
Fair enough.
To put it another way, if you write a test and if it gets affected
by externalities, perhaps you are testing a function that is at too
high a level that is not a suitable target for unit tested?
I am thinking about the recent "make repo-config callable with
repo==NULL outside a repository" topic, for example, and I suspect
repo_config() is in a layer that is at a bit too high for suitable
unit test target.
Thanks.
next prev parent reply other threads:[~2025-03-03 14:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 20:48 [BUG/WIP PATCH] unit-tests: use clean test environment Michael J Gruber
2025-02-28 10:50 ` Patrick Steinhardt
2025-02-28 14:15 ` Junio C Hamano
2025-03-03 10:33 ` Patrick Steinhardt
2025-03-03 10:49 ` Michael J Gruber
2025-03-03 14:07 ` Junio C Hamano [this message]
2025-03-04 7:30 ` Jeff King
2025-03-04 7:39 ` Patrick Steinhardt
2025-03-04 8:33 ` Jeff King
2025-03-04 15:54 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqzfi2xl5q.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@grubix.eu \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.