threads / discuss / 3850

t5501-old-fetch-and-upload.sh fails with NO_PYTHON=1

Subject: t5501-old-fetch-and-upload.sh fails with NO_PYTHON=1

## tl;dr

3 messages between Apr 11, 2006 and Apr 11, 2006.

replies: 2people: 3as markdown or json

Dennis Stosberg· Apr 11, 2006, 17:05 UTC · lore
Hello,

t/t5501-old-fetch-and-upload.sh fails on Solaris 9 with NO_PYTHON=1. The test doesn't work correctly on Linux with NO_PYTHON=1, too, but it doesn't cause a failure there.

When NO_PYTHON=1 is set, t/Makefile passes "--no-python" to the test as an argument. That causes the $list variable to be set to "--no-python" instead of "fetch upload". Since that string does not identify a program to be tested, $pgm remains unset.

On Linux the return code of "which $pgm" is 1 in that case, which causes the test to do nothing and exit without failure. In contrast, the return code of "which" without any argument is 0 on Solaris, so the test is being run and fails.

I have attached a simple fix, but is this test still useful at all?

Regards, Dennis

diff --git a/t/t5501-old-fetch-and-upload.sh b/t/t5501-old-fetch-and-upload.sh
index 596c88b..df69d97 100755
--- a/t/t5501-old-fetch-and-upload.sh
+++ b/t/t5501-old-fetch-and-upload.sh
@@ -13,10 +13,11 @@ tmp=`pwd`/.tmp$$
 
 retval=0
 
-if [ -z "$1" ]; then
+tests=`echo "$@"| sed -e 's/--[a-zA-Z\-]*//g'`
+if [ -z "$tests" ]; then
 	list="fetch upload"
 else
-	list="$@"
+	list="$tests"
 fi
 
 for i in $list; do
Junio C Hamano· Apr 11, 2006, 18:06 UTC · re: Dennis Stosberg · lore

Re: t5501-old-fetch-and-upload.sh fails with NO_PYTHON=1

Dennis Stosberg <dennis@stosberg.net> writes:
> I have attached a simple fix, but is this test still useful at all?

Thanks. I am inclined to say that when we need the "make sure this updated send-pack works with older receive-pack and vice versa" tests the next time, the framework to call the counterpart program from different vintage might be reusable but what the test tries to test would be different, so keeping this particular test would be somewhat useful as reference and perhaps a starting point for such new test, but otherwise not very much. And for that kind of usage, "the Net never forgets".

I'd vote for its removal.  Thoughts?
Johannes Schindelin· Apr 11, 2006, 21:31 UTC · re: Junio C Hamano · lore

Re: t5501-old-fetch-and-upload.sh fails with NO_PYTHON=1

Hi,
On Tue, 11 Apr 2006, Junio C Hamano wrote:
> [...] so keeping this particular test would be somewhat useful as 
> reference and perhaps a starting point for such new test, but otherwise 
> not very much.  And for that kind of usage, "the Net never forgets".

Not only that. Git itself never forgets. "git-cat-file blob 596c88b" will probably work virtually forever.

> I'd vote for its removal.  Thoughts?
Yeah.

Ciao, Dscho

← back to recent threads