git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Test 9500 - unhelpful without Perl::CGI
@ 2011-06-15  2:37 Linus Torvalds
  2011-06-15  5:59 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2011-06-15  2:37 UTC (permalink / raw)
  To: Git Mailing List, Junio C Hamano

This has probably been going on forever, and the only reason I noticed
is that I had a machine that doesn't have perl-CGI installed.

I'm talking about t9500-gitweb-standalone-no-errors.

Anyway, if you don't have that, the test fails at everything, and it
does so without any clues about _why_ it fails. I ended up figuring it
out by doing a "strace -f" to see what seems to be wrong.

Maybe that test could have some additional check for "is perl::CGI
installed at all" and at least give a useful error message rather than
just saying it failed?

                    Linus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Test 9500 - unhelpful without Perl::CGI
  2011-06-15  2:37 Test 9500 - unhelpful without Perl::CGI Linus Torvalds
@ 2011-06-15  5:59 ` Junio C Hamano
  2011-06-15  7:26   ` Sverre Rabbelier
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2011-06-15  5:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Git Mailing List

Linus Torvalds <torvalds@linux-foundation.org> writes:

> This has probably been going on forever, and the only reason I noticed
> is that I had a machine that doesn't have perl-CGI installed.
>
> I'm talking about t9500-gitweb-standalone-no-errors.
>
> Anyway, if you don't have that, the test fails at everything, and it
> does so without any clues about _why_ it fails.

Something like this would hopefully suffice.

It seems that we do test for the version of Encode, but we do not
specifically test CGI or other modules that people do not have to slurp
from CPAN?

 t/gitweb-lib.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 143eb1f..292753f 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -107,4 +107,9 @@ perl -MEncode -e '$e="";decode_utf8($e, Encode::FB_CROAK)' >/dev/null 2>&1 || {
 	test_done
 }
 
+perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
+	skip_all='skipping gitweb tests, CGI module unusable'
+	test_done
+}
+
 gitweb_init

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: Test 9500 - unhelpful without Perl::CGI
  2011-06-15  5:59 ` Junio C Hamano
@ 2011-06-15  7:26   ` Sverre Rabbelier
  2011-06-15 16:51     ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Sverre Rabbelier @ 2011-06-15  7:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Linus Torvalds, Git Mailing List

Heya,

On Wed, Jun 15, 2011 at 07:59, Junio C Hamano <gitster@pobox.com> wrote:
> +perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
> +       skip_all='skipping gitweb tests, CGI module unusable'
> +       test_done
> +}
> +

Isn't the new style to use test_must_succeed CGI_AVAILABLE '...' '...'
rather than skip_all+test_done?

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Test 9500 - unhelpful without Perl::CGI
  2011-06-15  7:26   ` Sverre Rabbelier
@ 2011-06-15 16:51     ` Junio C Hamano
  2011-06-15 17:05       ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2011-06-15 16:51 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: Junio C Hamano, Linus Torvalds, Git Mailing List

Sverre Rabbelier <srabbelier@gmail.com> writes:

> On Wed, Jun 15, 2011 at 07:59, Junio C Hamano <gitster@pobox.com> wrote:
>> +perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
>> +       skip_all='skipping gitweb tests, CGI module unusable'
>> +       test_done
>> +}
>> +
>
> Isn't the new style to use test_must_succeed CGI_AVAILABLE '...' '...'
> rather than skip_all+test_done?

I do not think that adds any value, at least in this case.  Besides, look
at the context line above what you quoted ;-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Test 9500 - unhelpful without Perl::CGI
  2011-06-15 16:51     ` Junio C Hamano
@ 2011-06-15 17:05       ` Junio C Hamano
  2011-06-15 18:36         ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2011-06-15 17:05 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Sverre Rabbelier, git, Linus Torvalds

Junio C Hamano <gitster@pobox.com> writes:

> Sverre Rabbelier <srabbelier@gmail.com> writes:
>
>> Isn't the new style to use test_must_succeed CGI_AVAILABLE '...' '...'
>> rather than skip_all+test_done?
>
> I do not think that adds any value, at least in this case.  Besides, look
> at the context line above what you quoted ;-)

In any case, I'd justify it like this and queue.  Thanks for noticing.

-- >8 --
Subject: [PATCH] t/gitweb-lib.sh: skip gitweb tests when perl dependencies are not met

Linus noticed that we go ahead testing gitweb and fail miserably on a
box with Perl but not perl-CGI library. We already have a code to detect
lack of Perl and refrain from testing gitweb in t/gitweb-lib.sh (by the
way, shouldn't it be called t/lib-gitweb.sh?), so let's extend it
to cover this case as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/gitweb-lib.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 143eb1f..292753f 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -107,4 +107,9 @@ perl -MEncode -e '$e="";decode_utf8($e, Encode::FB_CROAK)' >/dev/null 2>&1 || {
 	test_done
 }
 
+perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
+	skip_all='skipping gitweb tests, CGI module unusable'
+	test_done
+}
+
 gitweb_init
-- 
1.7.6.rc1.119.g85fc2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: Test 9500 - unhelpful without Perl::CGI
  2011-06-15 17:05       ` Junio C Hamano
@ 2011-06-15 18:36         ` Linus Torvalds
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2011-06-15 18:36 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jakub Narebski, Sverre Rabbelier, git

On Wed, Jun 15, 2011 at 10:05 AM, Junio C Hamano <gitster@pobox.com> wrote:
>
> Subject: [PATCH] t/gitweb-lib.sh: skip gitweb tests when perl dependencies are not met

Looks good. This makes t9500 go from

   not ok - 1 no commits: projects_list (implicit)
   #	gitweb_run
   not ok - 2 no commits: projects_index
   #	gitweb_run "a=project_index"
   not ok - 3 no commits: .git summary (implicit)
   #	gitweb_run "p=.git"
   not ok - 4 no commits: .git commit (implicit HEAD)
   ...
   not ok - 98 categories: projects list, only default category
   #	echo "\$projects_list_group_categories = 1;" >>gitweb_config.perl &&
   #		 gitweb_run
   # failed 91 among 98 test(s)
   1..98

to

  # passed all 0 test(s)
  1..0 # SKIP skipping gitweb tests, CGI module unusable

without perl-CGI installed. And with perl-CGI installed I obviously get

   ...
   ok 97 - ctags: malformed tag weights
   ok 98 - categories: projects list, only default category
   # passed all 98 test(s)
   1..98

So Ack on that patch.

   Thanks,
                           Linus

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-06-15 18:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-15  2:37 Test 9500 - unhelpful without Perl::CGI Linus Torvalds
2011-06-15  5:59 ` Junio C Hamano
2011-06-15  7:26   ` Sverre Rabbelier
2011-06-15 16:51     ` Junio C Hamano
2011-06-15 17:05       ` Junio C Hamano
2011-06-15 18:36         ` Linus Torvalds

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 NNTP newsgroup(s).