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.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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 8FC681F8C6 for ; Mon, 6 Sep 2021 04:20:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234306AbhIFEVO (ORCPT ); Mon, 6 Sep 2021 00:21:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbhIFEVN (ORCPT ); Mon, 6 Sep 2021 00:21:13 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49E27C061575 for ; Sun, 5 Sep 2021 21:20:09 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id u16so7720826wrn.5 for ; Sun, 05 Sep 2021 21:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=UBDbCT58N3KL2mK5p3RGH3vVS56sgnyQ1TF+iSzrAWA=; b=MGykcybS8KlCq5uXO1CFQmgzJVKQBncZ+QsuVxszxPKzg8g0M3b1QIMht2wzSeUwnT nEespto7DZXSGvXJl6DLFMVilVX0VqPByyzOcaKwybwOg8Lpm9lzEolayfz/bgBIMxBQ yQyJw+v3t2yxOmI21U0vKo2HPvwfGDogcLuTY6GK4JJ86VNBXjzg8ULGsVWMqkoy5NuG wEwS0OSwY9Hs8PLJgYn8xA8Bd6ZG2qMhqNQcF9mm02s8+UH86ERzA728eJveKHM1+RCw xP50j8lNMCafj9Z6tyizwQDRTVKxD5XaMZhP7CFgIdV2nG1EoDjoQhHV8agJeBOglawz 2Zlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=UBDbCT58N3KL2mK5p3RGH3vVS56sgnyQ1TF+iSzrAWA=; b=i4uC2+HLuS34zaslWRHAFTgSIr19NauMn3KQcYSaQhjkf4EPsHfXcM+dJ2CHkw/M4X RV4b5VqBQfrUoEQ9gs/Eg5PIezweYKf5jT1Q2i+wkVozk4gM5VOLTuCcBivlm5pQ0qoP un+09QDuBX3dWT8d9qtQCsrfP+so2+3Q9q5NPg8PEWfIkFCXqq19a75Oi/5RxaCQklhA kZDliGgYWkTOAAcTRB/FI1uvC7/jZrH0QyXSBRIzqqNZTP6j0TbwojRPISCZAMGDRzOR LJXr2FPcBByoJHPI8I3WelQ+vWsbCnjl5kk2X2fKBGtpCbBXpEMaMwjUo9D8HsQ8SEEf dJjw== X-Gm-Message-State: AOAM531Rd0RconFUKIUjTUu2rxCYQ94jk2XP9HyF9hcRcTG5hSJbRnOM uZBRdm4f8SUXhvAdWKd6DTpPEF1rbs0= X-Google-Smtp-Source: ABdhPJwCHA+634a4zrTVa7G+TF/5E/c2HIRkSrojmH7kGC/E8AznfLOADrDrYjSJv3XT1Eo61wZ7oQ== X-Received: by 2002:a5d:5107:: with SMTP id s7mr10584171wrt.283.1630902007867; Sun, 05 Sep 2021 21:20:07 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f23sm5148474wmc.3.2021.09.05.21.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Sep 2021 21:20:07 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Philippe Blain via GitGitGadget" Date: Mon, 06 Sep 2021 04:20:03 +0000 Subject: [PATCH v4 0/3] test-lib-functions.sh: keep user's HOME, TERM and SHELL for 'test_pause' and 'debug' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fcc: Sent To: git@vger.kernel.org Cc: SZEDER =?UTF-8?Q?G=C3=A1bor?= , Elijah Newren , Johannes Schindelin , Jens Lehmann , Eric Sunshine , Taylor Blau , Carlo Arenas , Jeff King , Philippe Blain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Changes since v3: * 2/3: improved the wording for the warning and caution as suggested by Elijah,, and moved the warning so it relates to the use of test_pause itself, not just the new flags, as suggested by Junio. Adapted the commit messages accordingly. * 3/3: changed the approach: instead of changing HOME, just copy ~/.gdbinit and ~/.lldbinit to the test HOME, as suggested by Carlo. This seems safer as this way $USER_HOME/.gitconfig does not interfere with the behaviour of the command being debugged (as Junio remarked in [1], but for test_pause). If other config files are needed for other debuggers, they can be added when the need arises. * [23]/3: also adapted the synopsys of 'test_pause' and 'debug' in t/README for better discoverability of the new features. [1] https://lore.kernel.org/git/xmqqa6kvoptx.fsf@gitster.g/ v3: * Added '-a' flag as suggested by Elijah, equivalent to '-t -s -h' for 'test_pause' and to '-t -h' for 'debug' v2: * added 1/3 as a preliminary step to use TEST_SHELL_PATH in test_pause instead of SHELL_PATH, as suggested by Carlo * implemented the change in behaviour through optional flags in both test_pause and debug. This seemed to be the simplest way to keep the current behaviour but also provide a way to improve the UX. v1: This series proposes two small quality-of-life improvements (in my opinion) to the 'test_pause' and 'debug' test functions: using the original values of HOME and TERM (before they are changed by the test framework) and using SHELL instead of SHELL_PATH. The later might be too big of a change, but I think it makes sense. We could add a new GIT_TEST_* to conditionnaly change the behaviour, but I kept it simple for v1. Cheers, Philippe. Philippe Blain (3): test-lib-functions: use 'TEST_SHELL_PATH' in 'test_pause' test-lib-functions: optionally keep HOME, TERM and SHELL in 'test_pause' test-lib-functions: keep user's debugger config files and TERM in 'debug' t/README | 11 ++-- t/test-lib-functions.sh | 113 ++++++++++++++++++++++++++++++++++------ t/test-lib.sh | 6 ++- 3 files changed, 109 insertions(+), 21 deletions(-) base-commit: 225bc32a989d7a22fa6addafd4ce7dcd04675dbf Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1022%2Fphil-blain%2Ftest-pause-and-debug-easier-v4 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1022/phil-blain/test-pause-and-debug-easier-v4 Pull-Request: https://github.com/gitgitgadget/git/pull/1022 Range-diff vs v3: 1: 2f566f330e0 = 1: 2f566f330e0 test-lib-functions: use 'TEST_SHELL_PATH' in 'test_pause' 2: 328b5d6e76f ! 2: a231d560e68 test-lib-functions: optionally keep HOME, TERM and SHELL in 'test_pause' @@ Commit message that developer's interactive shell is used. We use options instead of changing the behaviour unconditionally since - these three variables can break test reproducibility. Moreover, using the - original HOME means tests could overwrite files in a user's home - directory. Be explicit about these caveats in the new 'Usage' section in - test-lib-functions.sh. + these three variables can slightly change command behaviour. Moreover, + using the original HOME means commands could overwrite files in a user's + home directory. Be explicit about these caveats in the new 'Usage' + section in test-lib-functions.sh. + Finally, add '[options]' to the test_pause synopsys in t/README, and + mention that the full list of helper functions and their options can be + found in test-lib-functions.sh. + + Helped-by: Elijah Newren Signed-off-by: Philippe Blain + ## t/README ## +@@ t/README: Test harness library + -------------------- + + There are a handful helper functions defined in the test harness +-library for your script to use. ++library for your script to use. Some of them are listed below; ++see test-lib-functions.sh for the full list and their options. + + - test_expect_success []