git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Gopal Yadav <gopunop@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [NEW] Git
Date: Tue, 18 Aug 2020 12:52:03 -0400	[thread overview]
Message-ID: <CAPig+cRF=PXWTgOzxAsMQ=bSUPnsORBKWUTk38BCvMSVzS=KJw@mail.gmail.com> (raw)
In-Reply-To: <CAAUOv8jP00_W6=qFBWL1RpV0Dd1Fh1k19PQ33ycBnwVMLfRypA@mail.gmail.com>

On Tue, Aug 18, 2020 at 8:23 AM Gopal Yadav <gopunop@gmail.com> wrote:
> I am new to git and have submitted a microproject to get familiar with
> the process of submitting patches. Would further like to work on
> resolving this issue https://github.com/gitgitgadget/git/issues/353
>
> Some questions regarding that:
> What is meant by skipping evaluation of lazy prereq?

If, in order to run successfully, a test requires a certain facility
or resource which may or may not be present on a particular system, it
can signal that requirement like this:

    test_expect_success PERL 'test title' '
        test body
    '

where PERL is the prerequisite. If Perl is not available on the
platform, then the test won't be run at all. Determining whether a
prerequisite is met can be done actively or lazily. If actively, then
the determination is done unconditionally for either all test scripts
or all tests in a script, which penalizes tests which don't even care
about a particular prerequisite. If done lazily, then the
determination is done only the first time some particular test needs
to know the answer.

Issue #353 is saying that if we know that we are skipping a test
anyhow due to --run= or GIT_SKIP_TESTS, then there is no point
checking the test's prerequisites (lazy or not). The fact that the
prerequisites are being checked even for tests which we know will be
skipped is wasteful.

> Does it mean that test_lazy_prereq() and test_run_lazy_prereq()
> functions should be skipped in tests which are instructed to be
> skipped by --run?
>
> So for example if we run $sh t0001-init.sh --run='1-33'
> Then current behaviour allows test_lazy_prereq() at line 319 to execute.
> But since we are not running tests past the 33rd test we don't want
> test_lazy_prereq() to be executed.
> Is this the problem statement?

No. test_lazy_prereq() is merely the function which defines how a lazy
prerequisites should be determined when the answer about the
prerequisite is actually needed. What #353 is saying is to not perform
the actual determination if a test which requires it isn't going to be
run.

Fixing the issue might be as simple as moving the test_verify_prereq()
call (and related "export") inside the 'if ! test_skip "$@"'
conditional in the test_expect_success() and test_expect_failure()
functions.

> I know the issue talks about something related to chains but I am
> thinking of starting by resolving the lazy prereq task first.

I took a look at the &&-chain logic and, as far as I can tell by both
direct inspection and by experimentation, the detection of broken
&&-chains is _not_ performed for tests which are being skipped. So, I
think that portion of #353 is just wrong.

  reply	other threads:[~2020-08-18 16:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 12:23 [NEW] Git Gopal Yadav
2020-08-18 16:52 ` Eric Sunshine [this message]
2020-08-19  7:18   ` Gopal Yadav

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='CAPig+cRF=PXWTgOzxAsMQ=bSUPnsORBKWUTk38BCvMSVzS=KJw@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=gopunop@gmail.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).