From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cI3YM7C/ol7iHAAA0tVLHw (envelope-from ) for ; Fri, 24 Apr 2020 10:30:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 8FpPC7e/ol49EQAAB5/wlQ (envelope-from ) for ; Fri, 24 Apr 2020 10:30:15 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 34B92942F5D for ; Fri, 24 Apr 2020 10:30:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 7D1576DE10D2; Fri, 24 Apr 2020 03:30:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id viQdw23418WB; Fri, 24 Apr 2020 03:30:09 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id B5A1B6DE136D; Fri, 24 Apr 2020 03:30:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 566E56DE136D for ; Fri, 24 Apr 2020 03:30:07 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f-Okux5Sw8Cu for ; Fri, 24 Apr 2020 03:30:04 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 168E06DE10D2 for ; Fri, 24 Apr 2020 03:30:03 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.92) (envelope-from ) id 1jRvam-00008S-11; Fri, 24 Apr 2020 06:29:56 -0400 Received: (nullmailer pid 2923688 invoked by uid 1000); Fri, 24 Apr 2020 10:29:54 -0000 From: David Bremner To: Milton Vandersloot , "notmuch@notmuchmail.org" Subject: Re: test_emacs_expect_t does ignore Emacs as prerequisite In-Reply-To: <4EC8sDKjAVEjYY1U-bmmhcOzj4Sekf_jKwOaaduMv3Oes4rNecwwrOLmvYbFwjGVd_5BW6PEeK7M0iMUKgOkHEwyETf-mjJqFexnKkqSUNM=@protonmail.com> References: <4EC8sDKjAVEjYY1U-bmmhcOzj4Sekf_jKwOaaduMv3Oes4rNecwwrOLmvYbFwjGVd_5BW6PEeK7M0iMUKgOkHEwyETf-mjJqFexnKkqSUNM=@protonmail.com> X-List-To: notmuch Date: Fri, 24 Apr 2020 07:29:54 -0300 Message-ID: <871rodkwgt.fsf@tethera.net> MIME-Version: 1.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Ollila Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: -1.21 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [-1.21 / 13.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; GENERIC_REPUTATION(0.00)[-0.4603395442927]; TO_DN_SOME(0.00)[]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.00), ip: 50.126.95.6(-0.46)]; R_SPF_ALLOW(-0.20)[+a]; RCVD_IN_DNSWL_MED(-0.20)[50.126.95.6:from]; MX_GOOD(-0.50)[notmuchmail.org]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[protonmail.com,notmuchmail.org]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[david@tethera.net,notmuch-bounces@notmuchmail.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[notmuchmail.org:email,protonmail.com:email]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; SPF_REPUTATION_HAM(0.00)[-0.44747492183906]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; DMARC_NA(0.00)[tethera.net]; HAS_LIST_UNSUB(-0.01)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: 0F1TMte+Ry8y Milton Vandersloot writes: > > [PATCH] Let test_emacs_expect_t respect missing external prerequisites > > test_emacs_expect_t did not test for missing prerequisites (even though > it called test_emacs which does it). Fix that by testing for missing > prerequisites. > I agree there's a bug here, but I'm not sure this is the best/cleanest fix. Maybe Tomi (in Cc) can comment. The logic for prerequisite checking is already opaque. For example test_skip is already calling test_check_missing_external_prereqs_ as a side effect. For starters I wonder if test_emacs should use a return value to indicate failure, along the lines of the patch at the end of the message. BTW, it will make our life easier if you follow https://notmuchmail.org/contributing/#index5h2; in particular using git-send-email and keeping the discussion/notes after ---. diff --git a/test/test-lib.sh b/test/test-lib.sh index 7f8a3a4d..eecc52f7 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -543,9 +543,8 @@ test_emacs_expect_t () { # Run the test. if ! test_skip "$test_subtest_name" then - test_emacs "(notmuch-test-run $1)" >/dev/null - - # Restore state after the test. + test_emacs "(notmuch-test-run $1)" || return + # Restore state after the test. exec 1>&6 2>&7 # Restore stdout and stderr inside_subtest= @@ -997,7 +996,7 @@ test_emacs () { test_require_external_prereq dtach || missing_dependencies=1 test_require_external_prereq emacs || missing_dependencies=1 test_require_external_prereq ${TEST_EMACSCLIENT} || missing_dependencies=1 - test -z "$missing_dependencies" || return + test -z "$missing_dependencies" || return 1 if [ -z "$EMACS_SERVER" ]; then emacs_tests="$NOTMUCH_SRCDIR/test/${this_test_bare}.el" @@ -1034,6 +1033,7 @@ test_emacs () { touch OUTPUT ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(notmuch-test-progn $*)" + return 0 } test_python() {