{"thread":{"id":"10130","subject":"git-cvsserver test failures (still)","startedAt":"2007-10-03T19:50:18Z","lastAt":"2007-10-04T01:43:47Z","messageCount":3,"participants":["Brian Gernhardt","Frank Lichtenheld"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"54742","messageId":"A78B5F62-4FCC-4650-9B0D-0F64FEDB8423@silverinsanity.com","threadId":"10130","inReplyTo":null,"subject":"git-cvsserver test failures (still)","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-10-03T19:50:18Z","receivedAt":"2007-10-03T19:50:18Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"Periodically I am reminded that the git-cvsserver does not pass it's  \ntests (t9400-git-cvsserver.sh) on my machine, so I once again ask for  \nhelp.  The failing tests are: (they say skip because this is from the  \nlast \"find other errors\" run)\n\n* skip 9: req_Root failure (strict-paths)\n* skip 11: req_Root failure (w/o strict-paths)\n* skip 13: req_Root failure (base-path)\n\nNo other tests fail, including other req_Root failure tests :\n\n*   ok 6: req_Root failure (relative pathname)\n*   ok 7: req_Root failure (conflicting roots)\n*   ok 15: req_Root failure (export-all w/o whitelist)\n\nAll three tests fail with the exact same error log:\n\nE /Users/brian/dev/git/t/trash/gitcvs.git/ does not seem to be a  \nvalid GIT repository\nE\nerror 1 /Users/brian/dev/git/t/trash/gitcvs.git/ is not a valid  \nrepository\nE Invalid root /Users/brian/dev/git/t/trash/gitcvs.git\n\nThis appears to be from git-cvsserver.perl:148-9:\n\n     req_Root('root', $line) # reuse Root\n        or die \"E Invalid root $line \\n\";\n\nThis fails the test suite because die() exits with code 255 (checked  \nwith \"perl -e 'die'; echo $?\"), which is outside what  \ntest_expect_failure accepts (see t/test-lib.sh:179).\n\nMy questions become:\n1) Why hasn't this hit anyone else?\n2) Is this where these tests are supposed to fail?\n3) If it is, should the code be using print and exit 1 instead of die?\n4) If not, should the test be altered to end with \"|| false\" or  \nsimilar so the test passes?\n\nI'd happily submit a patch to fix this, but don't know what the  \ncorrect fix is.\n\n~~ Brian Gernhardt\n"},{"id":"54785","messageId":"20071004011954.GK18024@planck.djpig.de","threadId":"10130","inReplyTo":"A78B5F62-4FCC-4650-9B0D-0F64FEDB8423@silverinsanity.com","subject":"Re: git-cvsserver test failures (still)","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-10-04T01:19:54Z","receivedAt":"2007-10-04T01:19:54Z","isPatch":false,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"Hi.\n\nSome investigations on this:\n\nOn Wed, Oct 03, 2007 at 03:50:18PM -0400, Brian Gernhardt wrote:\n> This appears to be from git-cvsserver.perl:148-9:\n> \n>     req_Root('root', $line) # reuse Root\n>        or die \"E Invalid root $line \\n\";\n> \n> This fails the test suite because die() exits with code 255 (checked  \n> with \"perl -e 'die'; echo $?\"), which is outside what  \n> test_expect_failure accepts (see t/test-lib.sh:179).\n> \n> My questions become:\n> 1) Why hasn't this hit anyone else?\n\ndie doesn't always quit with 255:\n\n\"exits with the current value of $! (errno).  If $! is 0, exits with the\nvalue of \"($? >> 8)\" (backtick ‘command‘ status).  If \"($? >> 8)\" is 0,\nexits with 255\"\n\nOn my system $! is 9 for these cases and so it exits with exit code 9.\n\n> 2) Is this where these tests are supposed to fail?\n\nyes, IIRC\n\n> 3) If it is, should the code be using print and exit 1 instead of die?\n\nI think that would be the best solution, yes.\n\n> 4) If not, should the test be altered to end with \"|| false\" or  \n> similar so the test passes?\n\nGruesse,\n-- \nFrank Lichtenheld <frank@lichtenheld.de>\nwww: http://www.djpig.de/\n"},{"id":"54786","messageId":"20071004014253.GA22390@Hermes.local","threadId":"10130","inReplyTo":"20071004011954.GK18024@planck.djpig.de","subject":"[PATCH] Use exit 1 instead of die when req_Root fails.","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-10-04T01:43:47Z","receivedAt":"2007-10-04T01:43:47Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"This was causing test failures because die was exiting 255.\n---\n\n This finally takes care of my test failures.\n \n git-cvsserver.perl |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex 13dbd27..0d55fec 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -145,8 +145,10 @@ if ($state->{method} eq 'pserver') {\n     }\n     my $request = $1;\n     $line = <STDIN>; chomp $line;\n-    req_Root('root', $line) # reuse Root\n-       or die \"E Invalid root $line \\n\";\n+    unless (req_Root('root', $line)) { # reuse Root\n+       print \"E Invalid root $line \\n\";\n+       exit 1;\n+    }\n     $line = <STDIN>; chomp $line;\n     unless ($line eq 'anonymous') {\n        print \"E Only anonymous user allowed via pserver\\n\";\n-- \n1.5.3.4.203.gcc61a\n"}]}