git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitweb tests: Skip tests when we don't have Time::HiRes
@ 2017-02-27 12:37 Ævar Arnfjörð Bjarmason
  2017-02-27 17:48 ` Jakub Narębski
  0 siblings, 1 reply; 7+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-02-27 12:37 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Change the gitweb tests to skip when we can't load the Time::HiRes
module.

This module has bee in perl core since v5.8, which is the oldest
version we support, however CentOS (and perhaps some other
distributions) carve it into its own non-core-perl package that's not
installed along with /usr/bin/perl by default. Without this we'll hard
fail the gitweb tests when trying to load the module.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/gitweb-lib.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index d5dab5a94f..116c3890e6 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -114,4 +114,9 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
 	test_done
 }
 
+perl -mTime::HiRes -e 0  >/dev/null 2>&1 || {
+	skip_all='skipping gitweb tests, Time::HiRes module unusable'
+	test_done
+}
+
 gitweb_init
-- 
2.11.0


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

* Re: [PATCH] gitweb tests: Skip tests when we don't have Time::HiRes
  2017-02-27 12:37 [PATCH] gitweb tests: Skip tests when we don't have Time::HiRes Ævar Arnfjörð Bjarmason
@ 2017-02-27 17:48 ` Jakub Narębski
  2017-02-27 18:25   ` Ævar Arnfjörð Bjarmason
                     ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jakub Narębski @ 2017-02-27 17:48 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason, git; +Cc: Junio C Hamano

W dniu 27.02.2017 o 13:37, Ævar Arnfjörð Bjarmason pisze:
> Change the gitweb tests to skip when we can't load the Time::HiRes
> module.

Could you tell us in the commit message why this module is needed?
Is it because gitweb loads it unconditionally, or does that at least
in the default configuration, or is it used in tests, or...?

[I see it is somewhat addressed below]

> 
> This module has bee in perl core since v5.8, which is the oldest

s/bee/been/

> version we support, however CentOS (and perhaps some other
> distributions) carve it into its own non-core-perl package that's not
> installed along with /usr/bin/perl by default. Without this we'll hard
> fail the gitweb tests when trying to load the module.

I see that it because gitweb.perl as the following at line 20:

	use Time::HiRes qw(gettimeofday tv_interval);

> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

Good catch (if a strange one...).

> ---
>  t/gitweb-lib.sh | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
> index d5dab5a94f..116c3890e6 100644
> --- a/t/gitweb-lib.sh
> +++ b/t/gitweb-lib.sh
> @@ -114,4 +114,9 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
>  	test_done
>  }
>  
> +perl -mTime::HiRes -e 0  >/dev/null 2>&1 || {
> +	skip_all='skipping gitweb tests, Time::HiRes module unusable'

Is "unusable" a good description, instead of "not found"?

> +	test_done
> +}
> +
>  gitweb_init
> 


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

* Re: [PATCH] gitweb tests: Skip tests when we don't have Time::HiRes
  2017-02-27 17:48 ` Jakub Narębski
@ 2017-02-27 18:25   ` Ævar Arnfjörð Bjarmason
  2017-03-01 21:15   ` [PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes Ævar Arnfjörð Bjarmason
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-02-27 18:25 UTC (permalink / raw)
  To: Jakub Narębski; +Cc: Git Mailing List, Junio C Hamano

On Mon, Feb 27, 2017 at 6:48 PM, Jakub Narębski <jnareb@gmail.com> wrote:
> W dniu 27.02.2017 o 13:37, Ævar Arnfjörð Bjarmason pisze:
>> Change the gitweb tests to skip when we can't load the Time::HiRes
>> module.
>
> Could you tell us in the commit message why this module is needed?
> Is it because gitweb loads it unconditionally, or does that at least
> in the default configuration, or is it used in tests, or...?
>
> [I see it is somewhat addressed below]
>
>>
>> This module has bee in perl core since v5.8, which is the oldest
>
> s/bee/been/

I'll clarify that in a re-roll & fix the typo, pending any other
comments. Thanks!

>> version we support, however CentOS (and perhaps some other
>> distributions) carve it into its own non-core-perl package that's not
>> installed along with /usr/bin/perl by default. Without this we'll hard
>> fail the gitweb tests when trying to load the module.
>
> I see that it because gitweb.perl as the following at line 20:
>
>         use Time::HiRes qw(gettimeofday tv_interval);
>
>>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>
> Good catch (if a strange one...).

This and the associated cvs tests failing as root patch I submitted
were discovered when trying to build git in the standard mock build
environment on CentOS. It creates a chroot and rpm installs just the
packages you declare, so issues like these crop up.

>> ---
>>  t/gitweb-lib.sh | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
>> index d5dab5a94f..116c3890e6 100644
>> --- a/t/gitweb-lib.sh
>> +++ b/t/gitweb-lib.sh
>> @@ -114,4 +114,9 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
>>       test_done
>>  }
>>
>> +perl -mTime::HiRes -e 0  >/dev/null 2>&1 || {
>> +     skip_all='skipping gitweb tests, Time::HiRes module unusable'
>
> Is "unusable" a good description, instead of "not found"?

Yeah it's odd, but I just copied the several lines above that use that phrasing.

>> +     test_done
>> +}
>> +
>>  gitweb_init
>>
>

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

* [PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes
  2017-02-27 17:48 ` Jakub Narębski
  2017-02-27 18:25   ` Ævar Arnfjörð Bjarmason
@ 2017-03-01 21:15   ` Ævar Arnfjörð Bjarmason
  2017-03-01 22:42     ` Junio C Hamano
  2017-03-01 21:15   ` [PATCH v2 1/2] gitweb tests: Change confusing "skip_all" phrasing Ævar Arnfjörð Bjarmason
  2017-03-01 21:15   ` [PATCH v2 2/2] gitweb tests: Skip tests when we don't have Time::HiRes Ævar Arnfjörð Bjarmason
  3 siblings, 1 reply; 7+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-03-01 21:15 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narębski,
	Ævar Arnfjörð Bjarmason

This was originally just one small patch, but Jakub Narębski pointed
out that calling the module "unusable" when we failed to load it was
confusing, so now the start of this series is just a rephrasing of an
existing error message I copied.

Ævar Arnfjörð Bjarmason (2):
  gitweb tests: Change confusing "skip_all" phrasing
  gitweb tests: Skip tests when we don't have Time::HiRes

 t/gitweb-lib.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.11.0


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

* [PATCH v2 1/2] gitweb tests: Change confusing "skip_all" phrasing
  2017-02-27 17:48 ` Jakub Narębski
  2017-02-27 18:25   ` Ævar Arnfjörð Bjarmason
  2017-03-01 21:15   ` [PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes Ævar Arnfjörð Bjarmason
@ 2017-03-01 21:15   ` Ævar Arnfjörð Bjarmason
  2017-03-01 21:15   ` [PATCH v2 2/2] gitweb tests: Skip tests when we don't have Time::HiRes Ævar Arnfjörð Bjarmason
  3 siblings, 0 replies; 7+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-03-01 21:15 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narębski,
	Ævar Arnfjörð Bjarmason

Change the phrasing so that instead of saying that the CGI module is
unusable, we say that it's not available.

This came up on the git mailing list in
<4b34e3a0-3da7-d821-2a7f-9a420ac1d3f6@gmail.com> from Jakub Narębski.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/gitweb-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index d5dab5a94f..59ef15efbd 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -110,7 +110,7 @@ perl -MEncode -e '$e="";decode_utf8($e, Encode::FB_CROAK)' >/dev/null 2>&1 || {
 }
 
 perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
-	skip_all='skipping gitweb tests, CGI module unusable'
+	skip_all='skipping gitweb tests, CGI & CGI::Util & CGI::Carp modules not available'
 	test_done
 }
 
-- 
2.11.0


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

* [PATCH v2 2/2] gitweb tests: Skip tests when we don't have Time::HiRes
  2017-02-27 17:48 ` Jakub Narębski
                     ` (2 preceding siblings ...)
  2017-03-01 21:15   ` [PATCH v2 1/2] gitweb tests: Change confusing "skip_all" phrasing Ævar Arnfjörð Bjarmason
@ 2017-03-01 21:15   ` Ævar Arnfjörð Bjarmason
  3 siblings, 0 replies; 7+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-03-01 21:15 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jakub Narębski,
	Ævar Arnfjörð Bjarmason

Change the gitweb tests to skip when we can't load the Time::HiRes
module.

Gitweb needs this module to work. It has been in perl core since v5.8,
which is the oldest version we support. However CentOS (and perhaps
some other distributions) carve it into its own non-core-perl package
that's not installed along with /usr/bin/perl by default. Without this
we'll hard fail the gitweb tests when trying to load the module.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/gitweb-lib.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 59ef15efbd..b7a73874e7 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -114,4 +114,9 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
 	test_done
 }
 
+perl -mTime::HiRes -e 0  >/dev/null 2>&1 || {
+	skip_all='skipping gitweb tests, Time::HiRes module not available'
+	test_done
+}
+
 gitweb_init
-- 
2.11.0


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

* Re: [PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes
  2017-03-01 21:15   ` [PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes Ævar Arnfjörð Bjarmason
@ 2017-03-01 22:42     ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2017-03-01 22:42 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Jakub Narębski

Thanks, will replace what has been on 'pu'.

Note that I'd dropped a double-SP from the latter one while queuing.

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

end of thread, other threads:[~2017-03-01 23:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-27 12:37 [PATCH] gitweb tests: Skip tests when we don't have Time::HiRes Ævar Arnfjörð Bjarmason
2017-02-27 17:48 ` Jakub Narębski
2017-02-27 18:25   ` Ævar Arnfjörð Bjarmason
2017-03-01 21:15   ` [PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes Ævar Arnfjörð Bjarmason
2017-03-01 22:42     ` Junio C Hamano
2017-03-01 21:15   ` [PATCH v2 1/2] gitweb tests: Change confusing "skip_all" phrasing Ævar Arnfjörð Bjarmason
2017-03-01 21:15   ` [PATCH v2 2/2] gitweb tests: Skip tests when we don't have Time::HiRes Ævar Arnfjörð Bjarmason

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).