Re: [PATCH] test: always report missing prereqs, independent of `--verbose' option
authorPieter Praet <pieter@praet.org>
Fri, 20 Jan 2012 00:24:02 +0000 (01:24 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:46 +0000 (09:42 -0800)
25/fcea0589b3ff611203cec47182954125aae20a [new file with mode: 0644]

diff --git a/25/fcea0589b3ff611203cec47182954125aae20a b/25/fcea0589b3ff611203cec47182954125aae20a
new file mode 100644 (file)
index 0000000..b63f8ca
--- /dev/null
@@ -0,0 +1,146 @@
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id D887A431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 16:26:08 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id FkeA7KeEoy9B for <notmuch@notmuchmail.org>;\r
+       Thu, 19 Jan 2012 16:26:08 -0800 (PST)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+       [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 019AB431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 16:26:07 -0800 (PST)\r
+Received: by wibhr12 with SMTP id hr12so19836wib.26\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 16:26:06 -0800 (PST)\r
+Received: by 10.180.106.165 with SMTP id gv5mr47662598wib.18.1327019166872;\r
+       Thu, 19 Jan 2012 16:26:06 -0800 (PST)\r
+Received: from localhost ([109.131.97.13])\r
+       by mx.google.com with ESMTPS id g12sm3250677wiw.10.2012.01.19.16.25.52\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 19 Jan 2012 16:26:06 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>,\r
+       Dmitry Kurochkin <dmitry.kurochkin@gmail.com>,\r
+       Ethan Glasser-Camp <glasse@cs.rpi.edu>\r
+Subject: Re: [PATCH] test: always report missing prereqs,\r
+       independent of `--verbose' option\r
+In-Reply-To: <yf64nvtce14.fsf@taco2.nixu.fi>\r
+References: <87d3aj8rcl.fsf@gmail.com>\r
+       <1326889181-32311-1-git-send-email-pieter@praet.org>\r
+       <yf64nvtce14.fsf@taco2.nixu.fi>\r
+User-Agent: Notmuch/0.11+99~gab86e73 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+Date: Fri, 20 Jan 2012 01:24:02 +0100\r
+Message-ID: <87d3afuspp.fsf@praet.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 20 Jan 2012 00:26:09 -0000\r
+\r
+On Wed, 18 Jan 2012 15:53:59 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> On Wed, 18 Jan 2012 13:19:41 +0100, Pieter Praet <pieter@praet.org> wrote:\r
+> > When tests are skipped due to missing prereqs, those prereqs are only\r
+> > displayed when running with the `--verbose' option.  This is essential\r
+> > information when troubleshooting, so always send to stdout.\r
+> > \r
+> > ---\r
+> \r
+> Instead of this the test suite could be enchanged so that\r
+> full log of the execution is stored somewhere and path\r
+> to that file is displayed at the end of test. Generally,\r
+> all output could stay available after tests exit so that\r
+> those could be investigated furtner.\r
+> \r
+\r
+Indeed.  AFAIK, this used to be possible using the `--tee' option,\r
+but the files it produces appear to be deleted when the tests finish.\r
+\r
+> (I tried to grep 'missing prerequisites' after running test\r
+> but did not find the info. the file opened for >&3 has been\r
+> deleted already?)\r
+> \r
+\r
+Hmmm, odd.\r
+\r
+Are you sure you were using my patch and/or the `--verbose' option?\r
+\r
+Works here, using this highly sophisticated Emacs-hiding wizardry:\r
+\r
+  #+begin_src sh\r
+    sudo mv /usr/bin/emacs /usr/bin/emacs.bak\r
+    make test | grep 'missing prerequisites'\r
+    sudo mv /usr/bin/emacs.bak /usr/bin/emacs\r
+  #+end_src\r
+\r
+(patent pending... ;)\r
+\r
+> Now I just see huge amounts of missing prerequisites: emacs(1)\r
+> in my output (I presume that doesn't happen due to my\r
+> hack to "hide" emacs).\r
+> \r
+\r
+When using my patch, you mean?\r
+\r
+Most likely because "$test_subtest_missing_external_prereqs_" is only\r
+reset at the beginning of every test series, so if an Emacs-dependent\r
+subtest is skipped, all subsequent skipped subtests will report that\r
+dependency as well, even if they were skipped due to a missing vi :).\r
+\r
+> But well, I'm not against applying this patch -- just that\r
+> the test system starts to get so rotten touching it gives\r
+> shivers...\r
+> \r
+\r
+I wouldn't say it's getting rotten, but yeah, "tread lightly" should\r
+probably be mandatory advice to those aspiring to explore its bowels...\r
+\r
+> Tomi\r
+> \r
+> > \r
+> >  test/test-lib.sh |    4 ++--\r
+> >  1 files changed, 2 insertions(+), 2 deletions(-)\r
+> > \r
+> > diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+> > index d1fbc05..6560628 100644\r
+> > --- a/test/test-lib.sh\r
+> > +++ b/test/test-lib.sh\r
+> > @@ -673,8 +673,8 @@ test_skip () {\r
+> >  \r
+> >  test_check_missing_external_prereqs_ () {\r
+> >    if test -n "$test_subtest_missing_external_prereqs_"; then\r
+> > -          say_color skip >&3 "missing prerequisites:"\r
+> > -          echo "$test_subtest_missing_external_prereqs_" >&3\r
+> > +          say_color skip >&1 "missing prerequisites:"\r
+> > +          echo "$test_subtest_missing_external_prereqs_" >&1\r
+> >            test_report_skip_ "$@"\r
+> >    else\r
+> >            false\r
+> > -- \r
+> > 1.7.8.1\r
+\r
+\r
+Peace\r
+\r
+-- \r
+Pieter\r