From: Fabian Stelzer <fs@gigacodes.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Adam Dinwoodie <adam@dinwoodie.org>, Jeff King <peff@peff.net>,
git@vger.kernel.org
Subject: [RFC PATCH] lib-test: show failed prereq was Re: [PATCH] t/lib-git.sh: fix ACL-related permissions failure
Date: Fri, 12 Nov 2021 17:01:01 +0100 [thread overview]
Message-ID: <20211112160101.xm7xi4474pgybrh4@fs> (raw)
In-Reply-To: <xmqqv916wh7t.fsf@gitster.g>
[-- Attachment #1: Type: text/plain, Size: 1713 bytes --]
On 05.11.2021 12:11, Junio C Hamano wrote:
>Adam Dinwoodie <adam@dinwoodie.org> writes:
>
>> This is probably a much broader conversation. I remember when I first
>> started packaging Git for Cygwin, I produced a release that didn't
>> have support for HTTPS URLs due to a missing dependency in my build
>> environment. The build and test suite all passed -- it assumed I just
>> wanted to build a release that didn't have HTTPS support -- so some
>> relatively critical function was silently skipped. I don't know how to
>> avoid that sort of issue other than relying on (a) user bug (or at
>> least missing function) reports and (b) folk building Git for
>> themselves/others periodically going through the output of the
>> configure scripts and the skipped subtests to make sure only expected
>> things get missed; neither of those options seem great to me.
>
>I agree with you that there needs a good way to enumerate what the
>unsatisfied prerequisites for a particular build are. That would
>have helped in your HTTPS situation.
>
Sorry for not replying earlier. I've been sick the last couple of days
and only slowly getting up to speed again. I will improve the prereq
tests in a new commit in the other patch series still in progress that
i'll shortly reroll.
As for the general prereq issue i ran into that as well during
development. When you depend on other patches / a specific version of
ssh-keygen for git I always have to remember to set the path correctly
or the tests might silently be ignored by the missing prereq. Usually
not a problem for single test runs, but when i run the full suite before
sending something.
So, here's a simple rfc patch to maybe start with addressing this issue.
[-- Attachment #2: Type: text/plain, Size: 1878 bytes --]
From 0e7e57e546ec969d31094405aecafd1b1f3cf4d8 Mon Sep 17 00:00:00 2001
From: Fabian Stelzer <fs@gigacodes.de>
Date: Fri, 12 Nov 2021 16:41:30 +0100
Subject: [RFC PATCH 1/2] test-lib: show failed prereq summary
Add failed prereqs to the test results.
Aggregate and then show them with the totals.
Signed-off-by: Fabian Stelzer <fs@gigacodes.de>
---
t/aggregate-results.sh | 12 ++++++++++++
t/test-lib.sh | 4 ++++
2 files changed, 16 insertions(+)
diff --git a/t/aggregate-results.sh b/t/aggregate-results.sh
index 7913e206ed..ad531cc75d 100755
--- a/t/aggregate-results.sh
+++ b/t/aggregate-results.sh
@@ -6,6 +6,7 @@ success=0
failed=0
broken=0
total=0
+missing_prereq=
while read file
do
@@ -30,10 +31,21 @@ do
broken=$(($broken + $value)) ;;
total)
total=$(($total + $value)) ;;
+ missing_prereq)
+ missing_prereq="$missing_prereq $value" ;;
esac
done <"$file"
done
+if test -n "$missing_prereq"
+then
+ unique_missing_prereq=$(
+ echo $missing_prereq | tr -s "," | \
+ sed -e 's/ //g' -e 's/^,//' -e 's/,$//' -e 's/,/\n/g' \
+ | sort | uniq | paste -s -d ',')
+ printf "\nmissing prereq: $unique_missing_prereq\n\n"
+fi
+
if test -n "$failed_tests"
then
printf "\nfailed test(s):$failed_tests\n\n"
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 2679a7596a..472387afec 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -669,6 +669,8 @@ test_fixed=0
test_broken=0
test_success=0
+test_missing_prereq=
+
test_external_has_tap=0
die () {
@@ -1068,6 +1070,7 @@ test_skip () {
then
of_prereq=" of $test_prereq"
fi
+ test_missing_prereq="$missing_prereq,$test_missing_prereq"
skipped_reason="missing $missing_prereq${of_prereq}"
fi
@@ -1175,6 +1178,7 @@ test_done () {
fixed $test_fixed
broken $test_broken
failed $test_failure
+ missing_prereq $test_missing_prereq
EOF
fi
--
2.31.1
[-- Attachment #3: Type: text/plain, Size: 964 bytes --]
From d13d4c8ccbd832e1d62044b18b8b771f6586ee2a Mon Sep 17 00:00:00 2001
From: Fabian Stelzer <fs@gigacodes.de>
Date: Fri, 12 Nov 2021 16:43:18 +0100
Subject: [RFC PATCH 2/2] test-lib: introduce required prereq for test runs
Allows setting GIT_TEST_REQUIRE_PREREQ to a number of prereqs that must
succeed for this run. Otherwise the test run will abort.
Signed-off-by: Fabian Stelzer <fs@gigacodes.de>
---
t/test-lib-functions.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index eef2262a36..d65995cd15 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -669,6 +669,14 @@ test_have_prereq () {
satisfied_this_prereq=t
;;
*)
+ if ! test -z $GIT_TEST_REQUIRE_PREREQ
+ then
+ case ",$GIT_TEST_REQUIRE_PREREQ," in
+ *,$prerequisite,*)
+ error "required prereq $prerequisite failed"
+ ;;
+ esac
+ fi
satisfied_this_prereq=
esac
--
2.31.1
next prev parent reply other threads:[~2021-11-12 16:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 19:25 [PATCH] t/lib-git.sh: fix ACL-related permissions failure Adam Dinwoodie
2021-11-04 19:49 ` Junio C Hamano
2021-11-04 20:03 ` Junio C Hamano
2021-11-04 22:36 ` Fabian Stelzer
2021-11-05 7:30 ` Junio C Hamano
2021-11-05 11:25 ` Adam Dinwoodie
2021-11-05 12:06 ` Jeff King
2021-11-05 12:13 ` Fabian Stelzer
2021-11-05 18:04 ` Junio C Hamano
2021-11-05 18:49 ` Adam Dinwoodie
2021-11-05 19:11 ` Junio C Hamano
2021-11-05 19:24 ` Adam Dinwoodie
2021-11-05 21:00 ` Carlo Arenas
2021-11-12 16:01 ` Fabian Stelzer [this message]
2021-11-13 6:10 ` [RFC PATCH] lib-test: show failed prereq was " Junio C Hamano
2021-11-13 14:43 ` Fabian Stelzer
2021-11-05 23:53 ` Jeff King
2021-11-05 23:39 ` Jeff King
2021-11-05 18:14 ` Junio C Hamano
2021-11-04 20:09 ` Ramsay Jones
2021-11-05 11:47 ` Adam Dinwoodie
2021-11-05 21:44 ` Ramsay Jones
2021-11-05 19:31 ` [PATCH v2] " Adam Dinwoodie
2021-11-05 21:03 ` Junio C Hamano
2021-11-08 16:40 ` Kerry, Richard
2021-11-08 19:14 ` Junio C Hamano
2021-11-09 17:23 ` Kerry, Richard
2021-11-09 18:19 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211112160101.xm7xi4474pgybrh4@fs \
--to=fs@gigacodes.de \
--cc=adam@dinwoodie.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).