From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id A3B571F5AD for ; Tue, 21 Apr 2020 20:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726112AbgDUUoQ (ORCPT ); Tue, 21 Apr 2020 16:44:16 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:54497 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726024AbgDUUoP (ORCPT ); Tue, 21 Apr 2020 16:44:15 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 4DA07BAF44; Tue, 21 Apr 2020 16:44:13 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=KNuA4mt96du6EojZ9Vtb8HMC/7Y=; b=KhOgPY hoGbhaoHvVQzXzE75lZ69HurvrB3XIRYQcWx2JX8UqwB6JwDZpY3YxpZijMCX+7M OKJR10Ncc3t2J8oDd+0E+OOEELsBUHyAzV8zs9aPCQlYydD6fMcmyIhcrbVsk6mt H+JAeae9rpNZENmlUe8xOxOZrjkasAcOKSkmQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=Xi9KfF++Zf8QW9o1l8LtJBjkmuIZJERc 0L1urokr/4SHapf9UH61RouWTwahb/MRZWor4xo0IsJgBB/E+zmvP/VYMUA/WTPK uyJyKW8VBt484BKAYZAyujpwSZx4wdYpUt95qK6VQpHLgPn4vA6OkUoIKxs7H047 wKeIi0Jwv7I= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 46A7EBAF43; Tue, 21 Apr 2020 16:44:13 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 90912BAF3E; Tue, 21 Apr 2020 16:44:10 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Denton Liu Cc: Eric Sunshine , Git Mailing List Subject: Re: [PATCH 6/8] t9164: don't use `test_must_fail test_cmp` References: <20200421201627.GA9357@generichostname> Date: Tue, 21 Apr 2020 13:44:08 -0700 In-Reply-To: <20200421201627.GA9357@generichostname> (Denton Liu's message of "Tue, 21 Apr 2020 16:16:27 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: DA5C56D8-8410-11EA-9508-B0405B776F7B-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Denton Liu writes: > On Mon, Apr 20, 2020 at 01:09:49PM -0700, Junio C Hamano wrote: >> Eric Sunshine writes: >> >> > On Mon, Apr 20, 2020 at 4:55 AM Denton Liu wrote: >> >> The test_must_fail function should only be used for git commands since >> >> we assume that external commands work sanely. Since test_cmp() just >> >> wraps an external command, replace `test_must_fail test_cmp` with >> >> `! test_cmp`. >> >> >> >> Signed-off-by: Denton Liu >> >> --- >> >> diff --git a/t/t9164-git-svn-dcommit-concurrent.sh b/t/t9164-git-svn-dcommit-concurrent.sh >> >> @@ -103,7 +103,7 @@ test_expect_success 'check if pre-commit hook fails' ' >> >> - test_must_fail svn_cmd commit -m "this commit should fail" && >> >> + ! svn_cmd commit -m "this commit should fail" && >> > >> > Hmm, this doesn't look like 'test_cmp' mentioned in the commit message. >> >> Yeah, the other hunk is about test_cmp and this hunk is about >> svn_cmd. The stated rationale applies to both wrappers, I think. >> >> Subject: [PATCH 6/8] t9164: use test_must_fail only on git >> >> The `test_must_fail` function should only be used for git commands; >> we are not in the business of catching segmentation fault by external >> commands. Shell helper functions test_cmp and svn_cmd used in this >> script are wrappers around external commands, so just use `! cmd` >> instead of `test_must_fail cmd` >> >> perhaps, without any change to the code? > > Thanks, this looks good to me too. Thanks. So the 4-patch test-must-fail-fix series is now complete? Whee.