{"thread":{"id":"54063","subject":"[NEW] Git","startedAt":"2020-08-18T12:23:20Z","lastAt":"2020-08-19T07:18:36Z","messageCount":3,"participants":["Gopal Yadav","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"403930","messageId":"CAAUOv8jP00_W6=qFBWL1RpV0Dd1Fh1k19PQ33ycBnwVMLfRypA@mail.gmail.com","threadId":"54063","inReplyTo":null,"subject":"[NEW] Git","fromName":"Gopal Yadav","fromEmail":"gopunop@gmail.com","sentAt":"2020-08-18T12:23:04Z","receivedAt":"2020-08-18T12:23:20Z","isPatch":false,"sender":{"key":"gopunop@gmail.com","avatar":null},"body":"Hi Everyone,\n\nI am new to git and have submitted a microproject to get familiar with\nthe process of submitting patches. Would further like to work on\nresolving this issue https://github.com/gitgitgadget/git/issues/353\n\nSome questions regarding that:\nWhat is meant by skipping evaluation of lazy prereq?\nDoes it mean that test_lazy_prereq() and test_run_lazy_prereq()\nfunctions should be skipped in tests which are instructed to be\nskipped by --run?\n\nSo for example if we run $sh t0001-init.sh --run='1-33'\nThen current behaviour allows test_lazy_prereq() at line 319 to execute.\nBut since we are not running tests past the 33rd test we don't want\ntest_lazy_prereq() to be executed.\nIs this the problem statement?\n\nI know the issue talks about something related to chains but I am\nthinking of starting by resolving the lazy prereq task first.\n"},{"id":"403957","messageId":"CAPig+cRF=PXWTgOzxAsMQ=bSUPnsORBKWUTk38BCvMSVzS=KJw@mail.gmail.com","threadId":"54063","inReplyTo":"CAAUOv8jP00_W6=qFBWL1RpV0Dd1Fh1k19PQ33ycBnwVMLfRypA@mail.gmail.com","subject":"Re: [NEW] Git","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-08-18T16:52:03Z","receivedAt":"2020-08-18T16:52:20Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Aug 18, 2020 at 8:23 AM Gopal Yadav <gopunop@gmail.com> wrote:\n> I am new to git and have submitted a microproject to get familiar with\n> the process of submitting patches. Would further like to work on\n> resolving this issue https://github.com/gitgitgadget/git/issues/353\n>\n> Some questions regarding that:\n> What is meant by skipping evaluation of lazy prereq?\n\nIf, in order to run successfully, a test requires a certain facility\nor resource which may or may not be present on a particular system, it\ncan signal that requirement like this:\n\n    test_expect_success PERL 'test title' '\n        test body\n    '\n\nwhere PERL is the prerequisite. If Perl is not available on the\nplatform, then the test won't be run at all. Determining whether a\nprerequisite is met can be done actively or lazily. If actively, then\nthe determination is done unconditionally for either all test scripts\nor all tests in a script, which penalizes tests which don't even care\nabout a particular prerequisite. If done lazily, then the\ndetermination is done only the first time some particular test needs\nto know the answer.\n\nIssue #353 is saying that if we know that we are skipping a test\nanyhow due to --run= or GIT_SKIP_TESTS, then there is no point\nchecking the test's prerequisites (lazy or not). The fact that the\nprerequisites are being checked even for tests which we know will be\nskipped is wasteful.\n\n> Does it mean that test_lazy_prereq() and test_run_lazy_prereq()\n> functions should be skipped in tests which are instructed to be\n> skipped by --run?\n>\n> So for example if we run $sh t0001-init.sh --run='1-33'\n> Then current behaviour allows test_lazy_prereq() at line 319 to execute.\n> But since we are not running tests past the 33rd test we don't want\n> test_lazy_prereq() to be executed.\n> Is this the problem statement?\n\nNo. test_lazy_prereq() is merely the function which defines how a lazy\nprerequisites should be determined when the answer about the\nprerequisite is actually needed. What #353 is saying is to not perform\nthe actual determination if a test which requires it isn't going to be\nrun.\n\nFixing the issue might be as simple as moving the test_verify_prereq()\ncall (and related \"export\") inside the 'if ! test_skip \"$@\"'\nconditional in the test_expect_success() and test_expect_failure()\nfunctions.\n\n> I know the issue talks about something related to chains but I am\n> thinking of starting by resolving the lazy prereq task first.\n\nI took a look at the &&-chain logic and, as far as I can tell by both\ndirect inspection and by experimentation, the detection of broken\n&&-chains is _not_ performed for tests which are being skipped. So, I\nthink that portion of #353 is just wrong.\n"},{"id":"403993","messageId":"CAAUOv8jraMz3+M_fddwAVcLNGPZehgosvHXyCSUx1u+555LmOA@mail.gmail.com","threadId":"54063","inReplyTo":"CAPig+cRF=PXWTgOzxAsMQ=bSUPnsORBKWUTk38BCvMSVzS=KJw@mail.gmail.com","subject":"Re: [NEW] Git","fromName":"Gopal Yadav","fromEmail":"gopunop@gmail.com","sentAt":"2020-08-19T07:18:17Z","receivedAt":"2020-08-19T07:18:36Z","isPatch":false,"sender":{"key":"gopunop@gmail.com","avatar":null},"body":"On Tue, Aug 18, 2020 at 10:22 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Tue, Aug 18, 2020 at 8:23 AM Gopal Yadav <gopunop@gmail.com> wrote:\n\n> No. test_lazy_prereq() is merely the function which defines how a lazy\n> prerequisites should be determined when the answer about the\n> prerequisite is actually needed. What #353 is saying is to not perform\n> the actual determination if a test which requires it isn't going to be\n> run.\n>\n> Fixing the issue might be as simple as moving the test_verify_prereq()\n> call (and related \"export\") inside the 'if ! test_skip \"$@\"'\n> conditional in the test_expect_success() and test_expect_failure()\n> functions.\n\nI see that test_verify_prereq() (and related export) being used inside\n3 different functions\nnamely test_expect_failure(), test_expect_success() and test_external().\nSo the solution here is to move these into the if ! test_skip block.\n\nThanks, will submit a patch.\n\n> > I know the issue talks about something related to chains but I am\n> > thinking of starting by resolving the lazy prereq task first.\n>\n> I took a look at the &&-chain logic and, as far as I can tell by both\n> direct inspection and by experimentation, the detection of broken\n> &&-chains is _not_ performed for tests which are being skipped. So, I\n> think that portion of #353 is just wrong.\n"}]}