{"thread":{"id":"10141","subject":"Re: [PATCH] t9400: Add some tests for checkout","startedAt":"2007-10-04T18:13:45Z","lastAt":"2007-10-04T19:25:49Z","messageCount":5,"participants":["Johannes Schindelin","Frank Lichtenheld"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"54863","messageId":"1191521625-2597-1-git-send-email-frank@lichtenheld.de","threadId":"10141","inReplyTo":null,"subject":"[PATCH] t9400: Add some tests for checkout","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-10-04T18:13:45Z","receivedAt":"2007-10-04T18:13:45Z","isPatch":true,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"Test the behaviour for non-branches (e.g. head) and\nnon-existant branches. Also make a test checkout with\npacked refs.\n\nSigned-off-by: Frank Lichtenheld <frank@lichtenheld.de>\n---\n t/t9400-git-cvsserver-server.sh |   48 ++++++++++++++++++++++++++++++++++++--\n 1 files changed, 45 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 641303e..11def84 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -246,11 +246,50 @@ test_expect_success 'gitcvs.ext.dbname' \\\n    test ! -f \"$SERVERDIR/gitcvs2.ext.master.sqlite\" &&\n    cmp \"$SERVERDIR/gitcvs.master.sqlite\" \"$SERVERDIR/gitcvs1.ext.master.sqlite\"'\n \n+# clean up\n+rm -fr cvswork2\n+rm -fr \"$SERVERDIR\"\n+cd \"$WORKDIR\" &&\n+git clone -q --local --bare \"$WORKDIR/.git\" \"$SERVERDIR\" >/dev/null 2>&1 &&\n+GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled true &&\n+GIT_DIR=\"$SERVERDIR\" git config gitcvs.logfile \"$SERVERDIR/gitcvs.log\" ||\n+exit 1\n \n-#------------\n-# CVS UPDATE\n-#------------\n+#--------------\n+# CVS CHECKOUT\n+#--------------\n+test_expect_success 'cvs checkout failure (HEAD)' \\\n+  'if GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 HEAD >cvs.log 2>&1\n+   then\n+     echo unexpected cvs success\n+     false\n+   else\n+     true\n+   fi &&\n+   cat cvs.log | grep -q \"not a branch\" &&\n+   test ! -d cvswork2'\n+rm -fr cvswork2\n \n+test_expect_success 'cvs checkout failure (foobar)' \\\n+  'if GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 foobar >cvs.log 2>&1\n+   then\n+     echo unexpected cvs success\n+     false\n+   else\n+     true\n+   fi &&\n+   cat cvs.log | grep -q \"not a branch\" &&\n+   test ! -d cvswork2'\n+rm -fr cvswork2\n+\n+test_expect_success 'cvs checkout (packed ref)' \\\n+  'GIT_DIR=\"$SERVERDIR\" git-gc &&\n+   test ! -f \"$SERVERDIR/refs/heads/master\" &&\n+   GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&\n+   diff -qr cvswork cvswork2'\n+\n+# clean up\n+rm -fr cvswork2\n rm -fr \"$SERVERDIR\"\n cd \"$WORKDIR\" &&\n git clone -q --local --bare \"$WORKDIR/.git\" \"$SERVERDIR\" >/dev/null 2>&1 &&\n@@ -258,6 +297,9 @@ GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled true &&\n GIT_DIR=\"$SERVERDIR\" git config gitcvs.logfile \"$SERVERDIR/gitcvs.log\" ||\n exit 1\n \n+#------------\n+# CVS UPDATE\n+#------------\n test_expect_success 'cvs update (create new file)' \\\n   'echo testfile1 >testfile1 &&\n    git add testfile1 &&\n-- \n1.5.3.3\n"},{"id":"54862","messageId":"Pine.LNX.4.64.0710041921490.4174@racer.site","threadId":"10141","inReplyTo":"1191521625-2597-1-git-send-email-frank@lichtenheld.de","subject":"Re: [PATCH] t9400: Add some tests for checkout","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-04T18:24:05Z","receivedAt":"2007-10-04T18:24:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 4 Oct 2007, Frank Lichtenheld wrote:\n\n> +# clean up\n> +rm -fr cvswork2\n> +rm -fr \"$SERVERDIR\"\n> +cd \"$WORKDIR\" &&\n> +git clone -q --local --bare \"$WORKDIR/.git\" \"$SERVERDIR\" >/dev/null 2>&1 &&\n> +GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled true &&\n> +GIT_DIR=\"$SERVERDIR\" git config gitcvs.logfile \"$SERVERDIR/gitcvs.log\" ||\n> +exit 1\n\nShould this not be in a test_expect_success, too?\n\n> -#------------\n> -# CVS UPDATE\n> -#------------\n> +#--------------\n> +# CVS CHECKOUT\n> +#--------------\n> +test_expect_success 'cvs checkout failure (HEAD)' \\\n> +  'if GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 HEAD >cvs.log 2>&1\n> +   then\n> +     echo unexpected cvs success\n> +     false\n> +   else\n> +     true\n> +   fi &&\n\nHow about \"! GIT_CONFIG...\" instead of the \"if..then..else..fi\" ?\n\n> +   cat cvs.log | grep -q \"not a branch\" &&\n> +   test ! -d cvswork2'\n> +rm -fr cvswork2\n\nAgain, for consistency, I'd include this in the test case.\n\nCiao,\nDscho\n"},{"id":"54864","messageId":"20071004191217.GC31659@planck.djpig.de","threadId":"10141","inReplyTo":"Pine.LNX.4.64.0710041921490.4174@racer.site","subject":"Re: [PATCH] t9400: Add some tests for checkout","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-10-04T19:12:17Z","receivedAt":"2007-10-04T19:12:17Z","isPatch":true,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"On Thu, Oct 04, 2007 at 07:24:05PM +0100, Johannes Schindelin wrote:\n> On Thu, 4 Oct 2007, Frank Lichtenheld wrote:\n> \n> > +# clean up\n> > +rm -fr cvswork2\n> > +rm -fr \"$SERVERDIR\"\n> > +cd \"$WORKDIR\" &&\n> > +git clone -q --local --bare \"$WORKDIR/.git\" \"$SERVERDIR\" >/dev/null 2>&1 &&\n> > +GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled true &&\n> > +GIT_DIR=\"$SERVERDIR\" git config gitcvs.logfile \"$SERVERDIR/gitcvs.log\" ||\n> > +exit 1\n> \n> Should this not be in a test_expect_success, too?\n\nSince I do this several times and since it is easier to see what tests\nit belongs to if it isn't buried in one of them, I would say \"no\".\n\n> > -#------------\n> > -# CVS UPDATE\n> > -#------------\n> > +#--------------\n> > +# CVS CHECKOUT\n> > +#--------------\n> > +test_expect_success 'cvs checkout failure (HEAD)' \\\n> > +  'if GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork2 HEAD >cvs.log 2>&1\n> > +   then\n> > +     echo unexpected cvs success\n> > +     false\n> > +   else\n> > +     true\n> > +   fi &&\n> \n> How about \"! GIT_CONFIG...\" instead of the \"if..then..else..fi\" ?\n\nI don't really care. IIRC I took the idiom from another testfile.\nSeveral other tests in this file already use it, too. So unless\nJunio prefers I change all occourences, I will not.\n\n> > +   cat cvs.log | grep -q \"not a branch\" &&\n> > +   test ! -d cvswork2'\n> > +rm -fr cvswork2\n> \n> Again, for consistency, I'd include this in the test case.\n\nAgain, I don't really care. But for consistency with the rest of the\nfile I will only change it if I'm asked to change all occourences.\n\nGruesse,\n-- \nFrank Lichtenheld <frank@lichtenheld.de>\nwww: http://www.djpig.de/\n"},{"id":"54865","messageId":"Pine.LNX.4.64.0710042015580.4174@racer.site","threadId":"10141","inReplyTo":"20071004191217.GC31659@planck.djpig.de","subject":"Re: [PATCH] t9400: Add some tests for checkout","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-04T19:17:07Z","receivedAt":"2007-10-04T19:17:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 4 Oct 2007, Frank Lichtenheld wrote:\n\n> On Thu, Oct 04, 2007 at 07:24:05PM +0100, Johannes Schindelin wrote:\n> > On Thu, 4 Oct 2007, Frank Lichtenheld wrote:\n> > \n> > > +# clean up\n> > > +rm -fr cvswork2\n> > > +rm -fr \"$SERVERDIR\"\n> > > +cd \"$WORKDIR\" &&\n> > > +git clone -q --local --bare \"$WORKDIR/.git\" \"$SERVERDIR\" >/dev/null 2>&1 &&\n> > > +GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled true &&\n> > > +GIT_DIR=\"$SERVERDIR\" git config gitcvs.logfile \"$SERVERDIR/gitcvs.log\" ||\n> > > +exit 1\n> > \n> > Should this not be in a test_expect_success, too?\n> \n> Since I do this several times and since it is easier to see what tests\n> it belongs to if it isn't buried in one of them, I would say \"no\".\n\nJust to clarify: I meant making an own \"test_expect_success\", a la \"setup\" \nin many other test scripts.\n\nBut I'm not the maintainer, so I'll just shut up.\n\nCiao,\nDscho\n"},{"id":"54867","messageId":"20071004192549.GD31659@planck.djpig.de","threadId":"10141","inReplyTo":"Pine.LNX.4.64.0710042015580.4174@racer.site","subject":"Re: [PATCH] t9400: Add some tests for checkout","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-10-04T19:25:49Z","receivedAt":"2007-10-04T19:25:49Z","isPatch":true,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"On Thu, Oct 04, 2007 at 08:17:07PM +0100, Johannes Schindelin wrote:\n> On Thu, 4 Oct 2007, Frank Lichtenheld wrote:\n> > On Thu, Oct 04, 2007 at 07:24:05PM +0100, Johannes Schindelin wrote:\n> > > Should this not be in a test_expect_success, too?\n> > \n> > Since I do this several times and since it is easier to see what tests\n> > it belongs to if it isn't buried in one of them, I would say \"no\".\n> \n> Just to clarify: I meant making an own \"test_expect_success\", a la \"setup\" \n> in many other test scripts.\n\nHmm, ok, will consider it. But as said, this should then be done for the\nwhole file at once, so I will definetly not change this particular\npatch.\n\nGruesse,\n-- \nFrank Lichtenheld <frank@lichtenheld.de>\nwww: http://www.djpig.de/\n"}]}