{"thread":{"id":"54073","subject":"[PATCH] Issue #353: Skipping lazy prereq for skipped tests","startedAt":"2020-08-20T16:02:33Z","lastAt":"2020-08-20T18:47:43Z","messageCount":2,"participants":["Gopal Yadav","René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"404101","messageId":"CAAUOv8gf7e=pFGgPBK5cb1_RusWEY7s+iWf95_ETTz_3juzggg@mail.gmail.com","threadId":"54073","inReplyTo":null,"subject":"[PATCH] Issue #353: Skipping lazy prereq for skipped tests","fromName":"Gopal Yadav","fromEmail":"gopunop@gmail.com","sentAt":"2020-08-20T16:01:59Z","receivedAt":"2020-08-20T16:02:33Z","isPatch":true,"sender":{"key":"gopunop@gmail.com","avatar":null},"body":" Skipping lazy prereq for test cases that are skipped via\n the --run option or via GIT_SKIP_TESTS. Issue 353:\n https://github.com/gitgitgadget/git/issues/353\n\nSigned-off-by: Gopal Yadav <gopunop@gmail.com>\n---\n t/test-lib-functions.sh | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 6a8e194a99..bac86ffd9d 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -578,10 +578,10 @@ test_expect_failure () {\n     test \"$#\" = 3 && { test_prereq=$1; shift; } || test_prereq=\n     test \"$#\" = 2 ||\n     BUG \"not 2 or 3 parameters to test-expect-failure\"\n-    test_verify_prereq\n-    export test_prereq\n     if ! test_skip \"$@\"\n     then\n+        test_verify_prereq\n+        export test_prereq\n         say >&3 \"checking known breakage of $TEST_NUMBER.$test_count '$1': $2\"\n         if test_run_ \"$2\" expecting_failure\n         then\n@@ -598,10 +598,10 @@ test_expect_success () {\n     test \"$#\" = 3 && { test_prereq=$1; shift; } || test_prereq=\n     test \"$#\" = 2 ||\n     BUG \"not 2 or 3 parameters to test-expect-success\"\n-    test_verify_prereq\n-    export test_prereq\n     if ! test_skip \"$@\"\n     then\n+        test_verify_prereq\n+        export test_prereq\n         say >&3 \"expecting success of $TEST_NUMBER.$test_count '$1': $2\"\n         if test_run_ \"$2\"\n         then\n@@ -627,10 +627,10 @@ test_external () {\n     BUG \"not 3 or 4 parameters to test_external\"\n     descr=\"$1\"\n     shift\n-    test_verify_prereq\n-    export test_prereq\n     if ! test_skip \"$descr\" \"$@\"\n     then\n+        test_verify_prereq\n+        export test_prereq\n         # Announce the script to reduce confusion about the\n         # test output that follows.\n         say_color \"\" \"# run $test_count: $descr ($*)\"\n-- \n2.20.1\n"},{"id":"404109","messageId":"c3ab29b6-39e8-b0a2-d628-873261850b98@web.de","threadId":"54073","inReplyTo":"CAAUOv8gf7e=pFGgPBK5cb1_RusWEY7s+iWf95_ETTz_3juzggg@mail.gmail.com","subject":"Re: [PATCH] Issue #353: Skipping lazy prereq for skipped tests","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-08-20T18:47:35Z","receivedAt":"2020-08-20T18:47:43Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 20.08.20 um 18:01 schrieb Gopal Yadav:\n>  Skipping lazy prereq for test cases that are skipped via\n>  the --run option or via GIT_SKIP_TESTS. Issue 353:\n>  https://github.com/gitgitgadget/git/issues/353\n>\n> Signed-off-by: Gopal Yadav <gopunop@gmail.com>\n> ---\n>  t/test-lib-functions.sh | 12 ++++++------\n>  1 file changed, 6 insertions(+), 6 deletions(-)\n>\n> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\n> index 6a8e194a99..bac86ffd9d 100644\n> --- a/t/test-lib-functions.sh\n> +++ b/t/test-lib-functions.sh\n> @@ -578,10 +578,10 @@ test_expect_failure () {\n>      test \"$#\" = 3 && { test_prereq=$1; shift; } || test_prereq=\n>      test \"$#\" = 2 ||\n>      BUG \"not 2 or 3 parameters to test-expect-failure\"\n> -    test_verify_prereq\n> -    export test_prereq\n>      if ! test_skip \"$@\"\n>      then\n> +        test_verify_prereq\n> +        export test_prereq\n\n$test_prereq is used as a named parameter of the function test_skip,\nwhich uses it to determine if a test needs to be skipped due to\nmissing prerequisites.  Checking and exporting its input parameter\nonly after it succeeded probably won't do any good.\n\nAnyway, didn't e0316695ec3 (test-lib: don't check prereqs of test\ncases that won't be run anyway, 2019-11-12) already solve the\nissue?\n\nRené\n"}]}