From patchwork Tue Aug 6 14:14:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13754949 Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80C1B18D637 for ; Tue, 6 Aug 2024 14:14:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722953681; cv=none; b=Jbb6gKHWCRcbZ9OyVbC97gTCpeVItA92n/PTbkWu6RrpJ6c67fSqr4+KfJuY5w6ao3iJr0g9YlS6ehKQgyg1MpckhndqNyOwMKku1BU/IhJP0qhjAtaJE03Pg6O+ZIO+D5GQ2hbPoh5/zqqgdh9vxPjDnEFKCoTsqhtyYIhi6b8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722953681; c=relaxed/simple; bh=ynKGghvxnQCblZM1ugB6JH5Zk9dzr8HWVWD5VPHboA0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c5vrnJggJMJEGhmy5vpGPL5M7eYqPtz9LSFkf9MKn/skHqHmBq+jeq6FPq0kap5hhimOadUqbox2ZrW63+ulrhNHOgDlNDqrXw0t+Lzpf8/u4c8JrEv7kk1mJ/IE+QuNlcATgLkdGRt4O0ELjIhuLoKDGeZX5sXeV270M6eXNoE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=h44okuqs; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=pYvmDbJt; arc=none smtp.client-ip=103.168.172.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="h44okuqs"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="pYvmDbJt" Received: from compute8.internal (compute8.nyi.internal [10.202.2.227]) by mailfout.nyi.internal (Postfix) with ESMTP id 911D0138DBA8; Tue, 6 Aug 2024 10:14:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute8.internal (MEProxy); Tue, 06 Aug 2024 10:14:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1722953678; x=1723040078; bh=CQxjmf2xl8 63CL5ixot29dBBTA2ca3v9xEVLijmGILc=; b=h44okuqstzYqxP3wK1l6WcCFqN BWusod9FVraTVRn5SFE1J2tEEGRRK1PofsZ2jnoi/t/KaDO7SOpOjT5IKKEPAcNc zQAYaj8gRlPBnDodcDoCmdHZ9jDZg2Uyspl+B96n+c5WIdatFdIjz/6MhBFlJ9nc BzeXcLwPVLyzzItVtJABUs1L6/cSZt34psw55WQHafLU80x+F2Hu3KGN+ZtZcHAP ghv7TDt7YSvQWunSJCTlT6ICs5ulGR5oWwRf0n7LBX07pE3Vv8qddER7E+Vmjslk leoaF99TqMHumIBgNcxhY2QnlNfyEl71HPVbJSNCLPM4wVF9Fx14FAnPbdBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1722953678; x=1723040078; bh=CQxjmf2xl863CL5ixot29dBBTA2c a3v9xEVLijmGILc=; b=pYvmDbJtlCU4inW8Gn9Wg8BRC50qvCuIxy0wtpHgV5Xm aUU3oPe6clbgso66gaaYrDDkomocACc7edHW57KMnSVyAYx0Fp8a9VrOczDOOA/2 CP6Rpv+///FWwOEfkfr8/gx2AP0vjiMky6rIBI338gkhv9qdQ5W+CQGdCd1S3NBV DjfbTDm+GwtSZ9HHwK0/TDbz122fBGDxIdzVetxHbzEgBJ1rd5aYDUZTE/Opk99m TcHEsbnQdk87Jhk2aywQ/XG5YZMK/n+1Ug6MIZxLqIr0F9L4jPxVMJIGSCz6JDBn 7doTaI07y6H3xex4nxq1EzohQTrGHfDZFYOgyhuVKQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrkeekgdejfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleffteen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesph hkshdrihhmpdhnsggprhgtphhtthhopedt X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Aug 2024 10:14:36 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 1faec0f5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 6 Aug 2024 14:14:34 +0000 (UTC) Date: Tue, 6 Aug 2024 16:14:34 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: =?utf-8?b?UmVuw6k=?= Scharfe , Junio C Hamano , Kyle Lippincott , Phillip Wood , Josh Steadmon , rsbecker@nexbridge.com, Edward Thomson Subject: [RFC PATCH v2 1/7] t: do not pass GIT_TEST_OPTS to unit tests with prove Message-ID: <78a9cc116253c8c638cc430bd0a842805105648b.1722952908.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: When using the prove target, we append GIT_TEST_OPTS to the arguments that we execute each of the tests with. This doesn't only include the intended test scripts, but also ends up passing the arguments to our unit tests. This is unintentional though as they do not even know to interpret those arguments, and is inconsistent with how we execute unit tests without prove. This isn't much of an issue because our current set of unit tests mostly ignore their arguments anyway. With the introduction of clar-based unit tests this is about to become an issue though, as these do parse their command line argument to alter behaviour. Prepare for this by passing GIT_TEST_OPTS to "run-test.sh" via an environment variable. Like this, we can conditionally forward it to our test scripts, only. --- t/Makefile | 3 ++- t/run-test.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/t/Makefile b/t/Makefile index 4c30e7c06f..d2212de0b7 100644 --- a/t/Makefile +++ b/t/Makefile @@ -68,7 +68,8 @@ failed: test -z "$$failed" || $(MAKE) $$failed prove: pre-clean check-chainlint $(TEST_LINT) - @echo "*** prove (shell & unit tests) ***"; $(CHAINLINTSUPPRESS) TEST_SHELL_PATH='$(TEST_SHELL_PATH_SQ)' $(PROVE) --exec ./run-test.sh $(GIT_PROVE_OPTS) $(T) $(UNIT_TESTS) :: $(GIT_TEST_OPTS) + @echo "*** prove (shell & unit tests) ***" + @$(CHAINLINTSUPPRESS) TEST_OPTIONS='$(GIT_TEST_OPTS)' TEST_SHELL_PATH='$(TEST_SHELL_PATH_SQ)' $(PROVE) --exec ./run-test.sh $(GIT_PROVE_OPTS) $(T) $(UNIT_TESTS) $(MAKE) clean-except-prove-cache $(T): diff --git a/t/run-test.sh b/t/run-test.sh index 13c353b91b..63328ac630 100755 --- a/t/run-test.sh +++ b/t/run-test.sh @@ -10,7 +10,7 @@ case "$1" in echo >&2 "ERROR: TEST_SHELL_PATH is empty or not set" exit 1 fi - exec "${TEST_SHELL_PATH}" "$@" + exec "${TEST_SHELL_PATH}" "$@" ${TEST_OPTIONS} ;; *) exec "$@"