git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [NEW] Git

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 18, 2020, 16:52 UTC
Message-ID
<CAPig+cRF=PXWTgOzxAsMQ=bSUPnsORBKWUTk38BCvMSVzS=KJw@mail.gmail.com>
In-Reply-To
<CAAUOv8jP00_W6=qFBWL1RpV0Dd1Fh1k19PQ33ycBnwVMLfRypA@mail.gmail.com>
On Tue, Aug 18, 2020 at 8:23 AM Gopal Yadav <gopunop@gmail.com> wrote:
Show 6 quoted lines
> 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.

Show 9 quoted lines
> 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.

Previous: Gopal YadavNext: Gopal Yadav
Message 2 of 3 in “[NEW] Git”
  1. Gopal YadavAug 18, 2020
  2. Eric SunshineAug 18, 2020
  3. Gopal YadavAug 19, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.