{"thread":{"id":"46779","subject":"[PATCH 2/2] t9010-*.sh: skip all tests if the PIPE prereq is missing","startedAt":"2017-09-17T22:58:26Z","lastAt":"2017-09-19T02:52:58Z","messageCount":2,"participants":["Ramsay Jones","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"328279","messageId":"ffcf72e9-b724-3312-ca63-c21d0b8a235c@ramsayjones.plus.com","threadId":"46779","inReplyTo":null,"subject":"[PATCH 2/2] t9010-*.sh: skip all tests if the PIPE prereq is missing","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2017-09-17T22:58:18Z","receivedAt":"2017-09-17T22:58:26Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nEvery test in this file, except one, is marked with the PIPE prereq.\nHowever, that lone test ('set up svn repo'), only performs some setup\nwork and checks whether the following test should be executed (by\nsetting an additional SVNREPO prerequisite). Since the following test\nalso requires the PIPE prerequisite, performing the setup test, when the\nPIPE preequisite is missing, is simply wasted effort. Use the skip-all\ntest facility to skip all tests when the PIPE prerequisite is missing.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n t/t9010-svn-fe.sh | 55 ++++++++++++++++++++++++++++---------------------------\n 1 file changed, 28 insertions(+), 27 deletions(-)\n\ndiff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh\nindex 6dafe7e99..8eaaca6f9 100755\n--- a/t/t9010-svn-fe.sh\n+++ b/t/t9010-svn-fe.sh\n@@ -4,12 +4,13 @@ test_description='check svn dumpfile importer'\n \n . ./test-lib.sh\n \n+if test_have_prereq !PIPE\n+then\n+\tskip_all=\"svn dumpfile importer testing requires the PIPE prerequisite\"\n+\ttest_done\n+fi\n+\n reinit_git () {\n-\tif ! test_declared_prereq PIPE\n-\tthen\n-\t\techo >&4 \"reinit_git: need to declare PIPE prerequisite\"\n-\t\treturn 127\n-\tfi\n \trm -fr .git &&\n \trm -f stream backflow &&\n \tgit init &&\n@@ -54,19 +55,19 @@ text_no_props () {\n \n >empty\n \n-test_expect_success PIPE 'empty dump' '\n+test_expect_success 'empty dump' '\n \treinit_git &&\n \techo \"SVN-fs-dump-format-version: 2\" >input &&\n \ttry_dump input\n '\n \n-test_expect_success PIPE 'v4 dumps not supported' '\n+test_expect_success 'v4 dumps not supported' '\n \treinit_git &&\n \techo \"SVN-fs-dump-format-version: 4\" >v4.dump &&\n \ttry_dump v4.dump must_fail\n '\n \n-test_expect_failure PIPE 'empty revision' '\n+test_expect_failure 'empty revision' '\n \treinit_git &&\n \tprintf \"rev <nobody, nobody@local>: %s\\n\" \"\" \"\" >expect &&\n \tcat >emptyrev.dump <<-\\EOF &&\n@@ -86,7 +87,7 @@ test_expect_failure PIPE 'empty revision' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success PIPE 'empty properties' '\n+test_expect_success 'empty properties' '\n \treinit_git &&\n \tprintf \"rev <nobody, nobody@local>: %s\\n\" \"\" \"\" >expect &&\n \tcat >emptyprop.dump <<-\\EOF &&\n@@ -109,7 +110,7 @@ test_expect_success PIPE 'empty properties' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success PIPE 'author name and commit message' '\n+test_expect_success 'author name and commit message' '\n \treinit_git &&\n \techo \"<author@example.com, author@example.com@local>\" >expect.author &&\n \tcat >message <<-\\EOF &&\n@@ -143,7 +144,7 @@ test_expect_success PIPE 'author name and commit message' '\n \ttest_cmp expect.author actual.author\n '\n \n-test_expect_success PIPE 'unsupported properties are ignored' '\n+test_expect_success 'unsupported properties are ignored' '\n \treinit_git &&\n \techo author >expect &&\n \tcat >extraprop.dump <<-\\EOF &&\n@@ -168,7 +169,7 @@ test_expect_success PIPE 'unsupported properties are ignored' '\n \ttest_cmp expect actual\n '\n \n-test_expect_failure PIPE 'timestamp and empty file' '\n+test_expect_failure 'timestamp and empty file' '\n \techo author@example.com >expect.author &&\n \techo 1999-01-01 >expect.date &&\n \techo file >expect.files &&\n@@ -210,7 +211,7 @@ test_expect_failure PIPE 'timestamp and empty file' '\n \ttest_cmp empty file\n '\n \n-test_expect_success PIPE 'directory with files' '\n+test_expect_success 'directory with files' '\n \treinit_git &&\n \tprintf \"%s\\n\" directory/file1 directory/file2 >expect.files &&\n \techo hi >hi &&\n@@ -263,7 +264,7 @@ test_expect_success PIPE 'directory with files' '\n \ttest_cmp hi directory/file2\n '\n \n-test_expect_success PIPE 'branch name with backslash' '\n+test_expect_success 'branch name with backslash' '\n \treinit_git &&\n \tsort <<-\\EOF >expect.branch-files &&\n \ttrunk/file1\n@@ -362,7 +363,7 @@ test_expect_success PIPE 'branch name with backslash' '\n \ttest_cmp expect.branch-files actual.branch-files\n '\n \n-test_expect_success PIPE 'node without action' '\n+test_expect_success 'node without action' '\n \treinit_git &&\n \tcat >inaction.dump <<-\\EOF &&\n \tSVN-fs-dump-format-version: 3\n@@ -383,7 +384,7 @@ test_expect_success PIPE 'node without action' '\n \ttry_dump inaction.dump must_fail\n '\n \n-test_expect_success PIPE 'action: add node without text' '\n+test_expect_success 'action: add node without text' '\n \treinit_git &&\n \tcat >textless.dump <<-\\EOF &&\n \tSVN-fs-dump-format-version: 3\n@@ -405,7 +406,7 @@ test_expect_success PIPE 'action: add node without text' '\n \ttry_dump textless.dump must_fail\n '\n \n-test_expect_failure PIPE 'change file mode but keep old content' '\n+test_expect_failure 'change file mode but keep old content' '\n \treinit_git &&\n \tcat >expect <<-\\EOF &&\n \tOBJID\n@@ -481,7 +482,7 @@ test_expect_failure PIPE 'change file mode but keep old content' '\n \ttest_cmp hello actual.target\n '\n \n-test_expect_success PIPE 'NUL in property value' '\n+test_expect_success 'NUL in property value' '\n \treinit_git &&\n \techo \"commit message\" >expect.message &&\n \t{\n@@ -507,7 +508,7 @@ test_expect_success PIPE 'NUL in property value' '\n \ttest_cmp expect.message actual.message\n '\n \n-test_expect_success PIPE 'NUL in log message, file content, and property name' '\n+test_expect_success 'NUL in log message, file content, and property name' '\n \t# Caveat: svnadmin 1.6.16 (r1073529) truncates at \\0 in the\n \t# svn:specialQnotreally example.\n \treinit_git &&\n@@ -587,7 +588,7 @@ test_expect_success PIPE 'NUL in log message, file content, and property name' '\n \ttest_cmp expect.hello2 actual.hello2\n '\n \n-test_expect_success PIPE 'change file mode and reiterate content' '\n+test_expect_success 'change file mode and reiterate content' '\n \treinit_git &&\n \tcat >expect <<-\\EOF &&\n \tOBJID\n@@ -667,7 +668,7 @@ test_expect_success PIPE 'change file mode and reiterate content' '\n \ttest_cmp hello actual.target\n '\n \n-test_expect_success PIPE 'deltas supported' '\n+test_expect_success 'deltas supported' '\n \treinit_git &&\n \t{\n \t\t# (old) h + (inline) ello + (old) \\n\n@@ -731,7 +732,7 @@ test_expect_success PIPE 'deltas supported' '\n \ttry_dump delta.dump\n '\n \n-test_expect_success PIPE 'property deltas supported' '\n+test_expect_success 'property deltas supported' '\n \treinit_git &&\n \tcat >expect <<-\\EOF &&\n \tOBJID\n@@ -796,7 +797,7 @@ test_expect_success PIPE 'property deltas supported' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success PIPE 'properties on /' '\n+test_expect_success 'properties on /' '\n \treinit_git &&\n \tcat <<-\\EOF >expect &&\n \tOBJID\n@@ -850,7 +851,7 @@ test_expect_success PIPE 'properties on /' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success PIPE 'deltas for typechange' '\n+test_expect_success 'deltas for typechange' '\n \treinit_git &&\n \tcat >expect <<-\\EOF &&\n \tOBJID\n@@ -935,7 +936,7 @@ test_expect_success PIPE 'deltas for typechange' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success PIPE 'deltas need not consume the whole preimage' '\n+test_expect_success 'deltas need not consume the whole preimage' '\n \treinit_git &&\n \tcat >expect <<-\\EOF &&\n \tOBJID\n@@ -1040,7 +1041,7 @@ test_expect_success PIPE 'deltas need not consume the whole preimage' '\n \ttest_cmp expect.3 actual.3\n '\n \n-test_expect_success PIPE 'no hang for delta trying to read past end of preimage' '\n+test_expect_success 'no hang for delta trying to read past end of preimage' '\n \treinit_git &&\n \t{\n \t\t# COPY 1\n@@ -1087,7 +1088,7 @@ test_expect_success 'set up svn repo' '\n \tfi\n '\n \n-test_expect_success SVNREPO,PIPE 't9135/svn.dump' '\n+test_expect_success SVNREPO 't9135/svn.dump' '\n \tmkdir -p simple-git &&\n \t(\n \t\tcd simple-git &&\n-- \n2.14.0\n"},{"id":"328336","messageId":"20170919025251.GF175206@aiede.mtv.corp.google.com","threadId":"46779","inReplyTo":"ffcf72e9-b724-3312-ca63-c21d0b8a235c@ramsayjones.plus.com","subject":"Re: [PATCH 2/2] t9010-*.sh: skip all tests if the PIPE prereq is missing","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-09-19T02:52:51Z","receivedAt":"2017-09-19T02:52:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ramsay Jones wrote:\n\n> Every test in this file, except one, is marked with the PIPE prereq.\n> However, that lone test ('set up svn repo'), only performs some setup\n> work and checks whether the following test should be executed (by\n> setting an additional SVNREPO prerequisite). Since the following test\n> also requires the PIPE prerequisite, performing the setup test, when the\n> PIPE preequisite is missing, is simply wasted effort. Use the skip-all\n> test facility to skip all tests when the PIPE prerequisite is missing.\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n>  t/t9010-svn-fe.sh | 55 ++++++++++++++++++++++++++++---------------------------\n>  1 file changed, 28 insertions(+), 27 deletions(-)\n\nIt was always the intention that this test script eventually be able\nto run on Windows, but it was not meant to be.  It would need to use a\nsocket or something for backflow to work on Windows.\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n"}]}