{"thread":{"id":"14218","subject":"[PATCH] Skip unwritable tests for root","startedAt":"2008-06-30T07:05:51Z","lastAt":"2008-07-07T19:14:06Z","messageCount":5,"participants":["Fernando J. Pereda","Jakub Narebski","Junio C Hamano","Lea Wiemann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"81723","messageId":"1214809551-14603-1-git-send-email-ferdy@ferdyx.org","threadId":"14218","inReplyTo":null,"subject":"[PATCH] Skip unwritable tests for root","fromName":"Fernando J. Pereda","fromEmail":"ferdy@ferdyx.org","sentAt":"2008-06-30T07:05:51Z","receivedAt":"2008-06-30T07:05:51Z","isPatch":true,"sender":{"key":"ferdy@ferdyx.org","avatar":"https://gravatar.com/avatar/96bf7c1ddf7ccd430255bd12d9d42b212dbc033b28c668a2bdf9c3995aa81e61?d=mp&s=160"},"body":"Signed-off-by: Fernando J. Pereda <ferdy@ferdyx.org>\n---\n t/t0004-unwritable.sh |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh\nindex 9255c63..728ec22 100755\n--- a/t/t0004-unwritable.sh\n+++ b/t/t0004-unwritable.sh\n@@ -4,6 +4,13 @@ test_description='detect unwritable repository and fail correctly'\n \n . ./test-lib.sh\n \n+if test \"$(id -u)\" -eq 0\n+then\n+\ttest_expect_success 'root writes to unwritable places, skipping test' :\n+\ttest_done\n+\texit\n+fi\n+\n test_expect_success setup '\n \n \t>file &&\n-- \n1.5.6.1\n"},{"id":"81727","messageId":"m3vdzrgymx.fsf@localhost.localdomain","threadId":"14218","inReplyTo":"1214809551-14603-1-git-send-email-ferdy@ferdyx.org","subject":"Re: [PATCH] Skip unwritable tests for root","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-30T07:39:26Z","receivedAt":"2008-06-30T07:39:26Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Fernando J. Pereda\" <ferdy@ferdyx.org> writes:\n\n> +if test \"$(id -u)\" -eq 0\n> +then\n> +\ttest_expect_success 'root writes to unwritable places, skipping test' :\n> +\ttest_done\n> +\texit\n> +fi\n\nYet another place that would profit from test_skip in test-lib.sh...\n(Junio uses \"say skip\" instead of \"test_expect_success\" in the place\nlike above here).\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"81731","messageId":"7vabh31e9p.fsf@gitster.siamese.dyndns.org","threadId":"14218","inReplyTo":"1214809551-14603-1-git-send-email-ferdy@ferdyx.org","subject":"Re: [PATCH] Skip unwritable tests for root","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-30T09:08:18Z","receivedAt":"2008-06-30T09:08:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Fernando J. Pereda\" <ferdy@ferdyx.org> writes:\n\n> Signed-off-by: Fernando J. Pereda <ferdy@ferdyx.org>\n\nHmm.  Actually we've deliberately ignored this so far.  If we were to do\nanything, don't we rather want to fail everything upfront when the tests\nare run by root?\n\nRunning \"make\" and \"make test\" before \"make install\" is so that you have\nless chance hurting your running system, and I find it simply crazy to\nbuild (i.e. \"make all\") as root, let alone running tests.\n"},{"id":"81733","messageId":"20080630092735.GA10979@ferdyx.org","threadId":"14218","inReplyTo":"7vabh31e9p.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Skip unwritable tests for root","fromName":"Fernando J. Pereda","fromEmail":"ferdy@ferdyx.org","sentAt":"2008-06-30T09:27:35Z","receivedAt":"2008-06-30T09:27:35Z","isPatch":true,"sender":{"key":"ferdy@ferdyx.org","avatar":"https://gravatar.com/avatar/96bf7c1ddf7ccd430255bd12d9d42b212dbc033b28c668a2bdf9c3995aa81e61?d=mp&s=160"},"body":"On Mon, Jun 30, 2008 at 02:08:18AM -0700, Junio C Hamano wrote:\n> \"Fernando J. Pereda\" <ferdy@ferdyx.org> writes:\n> \n> > Signed-off-by: Fernando J. Pereda <ferdy@ferdyx.org>\n> \n> Hmm.  Actually we've deliberately ignored this so far.  If we were to do\n> anything, don't we rather want to fail everything upfront when the tests\n> are run by root?\n> \n> Running \"make\" and \"make test\" before \"make install\" is so that you have\n> less chance hurting your running system, and I find it simply crazy to\n> build (i.e. \"make all\") as root, let alone running tests.\n\n*nod*\n\nThis originated because Gentoo can be told to build stuff as root (and\nrun test as root) under a sandbox. Since I already had the patch\nlocally, I guessed you might be interested in it and just sent it.\n\nI'll just apply it locally.\n\n- ferdy\n\n"},{"id":"82502","messageId":"48726AFE.3070400@gmail.com","threadId":"14218","inReplyTo":"7vabh31e9p.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Skip unwritable tests for root","fromName":"Lea Wiemann","fromEmail":"lewiemann@gmail.com","sentAt":"2008-07-07T19:14:06Z","receivedAt":"2008-07-07T19:14:06Z","isPatch":true,"sender":{"key":"lewiemann@gmail.com","avatar":null},"body":"Junio C Hamano wrote:\n> If we were to do anything, don't we rather want to fail everything upfront\n> when the tests are run by root [because it's crazy]?\n\nI think that unless/until someone wants to submit a patch that makes the\ntests fail upfront, we should use Fernando's patch; it's an improvement\nover the current situation.\n\nI'm actually not entirely sure if skipping or failing everything if the\ntests are run as root is a good idea -- for instance, neither skipping\nnor failing seems appropriate for Gentoo's root-in-a-sandbox situation.\n\nJakub Narebski wrote:\n> \"Fernando J. Pereda\" <ferdy@ferdyx.org> writes:\n>> +\ttest_expect_success '[...], skipping test' :\n>> +\ttest_done\n>> +\texit\n>\n> Yet another place that would profit from test_skip in test-lib.sh...\n\n*nods*  I'd rather name it 'test_skip_all' for clarity though, at least\nif it contains \"test_done; exit\".  (I'm not volunteering to send a\npatch, FTR...)\n"}]}