git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [NEW] Git
@ 2020-08-18 12:23 Gopal Yadav
  2020-08-18 16:52 ` Eric Sunshine
  0 siblings, 1 reply; 3+ messages in thread
From: Gopal Yadav @ 2020-08-18 12:23 UTC (permalink / raw)
  To: git

Hi Everyone,

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?
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?

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [NEW] Git
  2020-08-18 12:23 [NEW] Git Gopal Yadav
@ 2020-08-18 16:52 ` Eric Sunshine
  2020-08-19  7:18   ` Gopal Yadav
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sunshine @ 2020-08-18 16:52 UTC (permalink / raw)
  To: Gopal Yadav; +Cc: Git List

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [NEW] Git
  2020-08-18 16:52 ` Eric Sunshine
@ 2020-08-19  7:18   ` Gopal Yadav
  0 siblings, 0 replies; 3+ messages in thread
From: Gopal Yadav @ 2020-08-19  7:18 UTC (permalink / raw)
  To: git; +Cc: Johannes.Schindelin, sunshine

On Tue, Aug 18, 2020 at 10:22 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
>
> On Tue, Aug 18, 2020 at 8:23 AM Gopal Yadav <gopunop@gmail.com> wrote:

> 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 see that test_verify_prereq() (and related export) being used inside
3 different functions
namely test_expect_failure(), test_expect_success() and test_external().
So the solution here is to move these into the if ! test_skip block.

Thanks, will submit a patch.

> > 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-19  7:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 12:23 [NEW] Git Gopal Yadav
2020-08-18 16:52 ` Eric Sunshine
2020-08-19  7:18   ` Gopal Yadav

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).