{"thread":{"id":"45237","subject":"[PATCH] gitweb tests: Skip tests when we don't have Time::HiRes","startedAt":"2017-02-27T12:42:34Z","lastAt":"2017-02-27T18:55:53Z","messageCount":3,"participants":["Ævar Arnfjörð Bjarmason","Jakub Narębski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"312719","messageId":"20170227123720.8493-1-avarab@gmail.com","threadId":"45237","inReplyTo":null,"subject":"[PATCH] gitweb tests: Skip tests when we don't have Time::HiRes","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-02-27T12:37:20Z","receivedAt":"2017-02-27T12:42:34Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the gitweb tests to skip when we can't load the Time::HiRes\nmodule.\n\nThis module has bee in perl core since v5.8, which is the oldest\nversion we support, however CentOS (and perhaps some other\ndistributions) carve it into its own non-core-perl package that's not\ninstalled along with /usr/bin/perl by default. Without this we'll hard\nfail the gitweb tests when trying to load the module.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/gitweb-lib.sh | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nindex d5dab5a94f..116c3890e6 100644\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -114,4 +114,9 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {\n \ttest_done\n }\n \n+perl -mTime::HiRes -e 0  >/dev/null 2>&1 || {\n+\tskip_all='skipping gitweb tests, Time::HiRes module unusable'\n+\ttest_done\n+}\n+\n gitweb_init\n-- \n2.11.0\n\n"},{"id":"312729","messageId":"4b34e3a0-3da7-d821-2a7f-9a420ac1d3f6@gmail.com","threadId":"45237","inReplyTo":"20170227123720.8493-1-avarab@gmail.com","subject":"Re: [PATCH] gitweb tests: Skip tests when we don't have Time::HiRes","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2017-02-27T17:48:21Z","receivedAt":"2017-02-27T17:50:09Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"W dniu 27.02.2017 o 13:37, Ævar Arnfjörð Bjarmason pisze:\n> Change the gitweb tests to skip when we can't load the Time::HiRes\n> module.\n\nCould you tell us in the commit message why this module is needed?\nIs it because gitweb loads it unconditionally, or does that at least\nin the default configuration, or is it used in tests, or...?\n\n[I see it is somewhat addressed below]\n\n> \n> This module has bee in perl core since v5.8, which is the oldest\n\ns/bee/been/\n\n> version we support, however CentOS (and perhaps some other\n> distributions) carve it into its own non-core-perl package that's not\n> installed along with /usr/bin/perl by default. Without this we'll hard\n> fail the gitweb tests when trying to load the module.\n\nI see that it because gitweb.perl as the following at line 20:\n\n\tuse Time::HiRes qw(gettimeofday tv_interval);\n\n> \n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\nGood catch (if a strange one...).\n\n> ---\n>  t/gitweb-lib.sh | 5 +++++\n>  1 file changed, 5 insertions(+)\n> \n> diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\n> index d5dab5a94f..116c3890e6 100644\n> --- a/t/gitweb-lib.sh\n> +++ b/t/gitweb-lib.sh\n> @@ -114,4 +114,9 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {\n>  \ttest_done\n>  }\n>  \n> +perl -mTime::HiRes -e 0  >/dev/null 2>&1 || {\n> +\tskip_all='skipping gitweb tests, Time::HiRes module unusable'\n\nIs \"unusable\" a good description, instead of \"not found\"?\n\n> +\ttest_done\n> +}\n> +\n>  gitweb_init\n> \n\n"},{"id":"312754","messageId":"CACBZZX6gz8rs-Tf3DvG=J1WA5X+=ObfU-kGoDqVeeW0_ALQYXw@mail.gmail.com","threadId":"45237","inReplyTo":"4b34e3a0-3da7-d821-2a7f-9a420ac1d3f6@gmail.com","subject":"Re: [PATCH] gitweb tests: Skip tests when we don't have Time::HiRes","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-02-27T18:25:51Z","receivedAt":"2017-02-27T18:55:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Feb 27, 2017 at 6:48 PM, Jakub Narębski <jnareb@gmail.com> wrote:\n> W dniu 27.02.2017 o 13:37, Ævar Arnfjörð Bjarmason pisze:\n>> Change the gitweb tests to skip when we can't load the Time::HiRes\n>> module.\n>\n> Could you tell us in the commit message why this module is needed?\n> Is it because gitweb loads it unconditionally, or does that at least\n> in the default configuration, or is it used in tests, or...?\n>\n> [I see it is somewhat addressed below]\n>\n>>\n>> This module has bee in perl core since v5.8, which is the oldest\n>\n> s/bee/been/\n\nI'll clarify that in a re-roll & fix the typo, pending any other\ncomments. Thanks!\n\n>> version we support, however CentOS (and perhaps some other\n>> distributions) carve it into its own non-core-perl package that's not\n>> installed along with /usr/bin/perl by default. Without this we'll hard\n>> fail the gitweb tests when trying to load the module.\n>\n> I see that it because gitweb.perl as the following at line 20:\n>\n>         use Time::HiRes qw(gettimeofday tv_interval);\n>\n>>\n>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>\n> Good catch (if a strange one...).\n\nThis and the associated cvs tests failing as root patch I submitted\nwere discovered when trying to build git in the standard mock build\nenvironment on CentOS. It creates a chroot and rpm installs just the\npackages you declare, so issues like these crop up.\n\n>> ---\n>>  t/gitweb-lib.sh | 5 +++++\n>>  1 file changed, 5 insertions(+)\n>>\n>> diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\n>> index d5dab5a94f..116c3890e6 100644\n>> --- a/t/gitweb-lib.sh\n>> +++ b/t/gitweb-lib.sh\n>> @@ -114,4 +114,9 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {\n>>       test_done\n>>  }\n>>\n>> +perl -mTime::HiRes -e 0  >/dev/null 2>&1 || {\n>> +     skip_all='skipping gitweb tests, Time::HiRes module unusable'\n>\n> Is \"unusable\" a good description, instead of \"not found\"?\n\nYeah it's odd, but I just copied the several lines above that use that phrasing.\n\n>> +     test_done\n>> +}\n>> +\n>>  gitweb_init\n>>\n>\n"}]}