From e9521b0e0ac27aa1bd859e465d40c89cd548a670 Mon Sep 17 00:00:00 2001 From: Andreas Koenig Date: Sat, 28 Apr 2018 05:09:28 +0200 Subject: [PATCH] Support recently changed formatting of the reports coming from cpantesters --- Changes | 4 + lib/CPAN/Testers/ParseReport.pm | 5 +- t/ctgetreports.t | 30 ++++++ t/var/nntp-testers/94682624 | 211 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 248 insertions(+), 2 deletions(-) create mode 100644 t/var/nntp-testers/94682624 diff --git a/Changes b/Changes index d874f02..00f2503 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +0.4.2 2018-04-28 k + + * Support recently changed formatting of the reports coming from cpantesters + 0.4.1 2016-08-16 k * Declare dependency on List::MoreUtil diff --git a/lib/CPAN/Testers/ParseReport.pm b/lib/CPAN/Testers/ParseReport.pm index 5bb1564..407037f 100644 --- a/lib/CPAN/Testers/ParseReport.pm +++ b/lib/CPAN/Testers/ParseReport.pm @@ -27,7 +27,7 @@ CPAN::Testers::ParseReport - parse reports to www.cpantesters.org from various s =cut -use version; our $VERSION = qv('0.4.1'); +use version; our $VERSION = qv('0.4.2'); =head1 SYNOPSIS @@ -511,7 +511,8 @@ sub parse_report { my @previous_line = ""; # so we can neutralize line breaks my @rlines = split /\r?\n/, $report; LINE: for (@rlines) { - next LINE unless ($isHTML ? m/((\S+)\s+(\S+))/ : m/^Subject:\s*((\S+)\s+(\S+))/); + next LINE unless ($isHTML ? m/<title>((\S+)\s+(\S+))/ : m/^Subject:\s*((\S+)\s+(\S+))/) + || m{^Subject:\s*<strong>((\S+)\s+(\S+))}; my $s = $1; $s = $1 if $s =~ m{<strong>(.+)}; if ($s =~ /(\S+)\s+(\S+)/) { diff --git a/t/ctgetreports.t b/t/ctgetreports.t index b690fe4..6568c49 100644 --- a/t/ctgetreports.t +++ b/t/ctgetreports.t @@ -723,6 +723,36 @@ sub reportedvariableis ($$$$) { is $extract->{'mod:Date::Manip::DM5abbrevs'}, 'v6.47', "$id: mod:Date::Manip::DM5abbrevs"; } +{ + BEGIN { + $plan += 8; + } + my $id = 94682624; + my %Opt = ( + 'local' => 1, + 'cachedir' => 't/var', + 'quiet' => 1, + 'dumpvars' => ".", + 'report' => $id, + ); + my $dumpvars = {}; + $main::att=1; + my $extract = CPAN::Testers::ParseReport::parse_report + ( + "t/var/nntp-testers/$id", + $dumpvars, + %Opt, + ); + reportedvariableis $extract, $id, 'conf:usesocks', 'undef'; + reportedvariableis $extract, $id, 'conf:use64bitall', 'define'; + reportedvariableis $extract, $id, 'conf:use64bitint', 'define'; + reportedvariableis $extract, $id, 'conf:useposix', 'true'; + reportedvariableis $extract, $id, 'conf:usemymalloc', 'n'; + reportedvariableis $extract, $id, 'conf:d_sfio', 'undef'; + reportedvariableis $extract, $id, 'conf:bincompat5005', 'undef'; + reportedvariableis $extract, $id, 'mod:File::Path', '2.15'; +} + unlink "ctgetreports.out"; BEGIN { diff --git a/t/var/nntp-testers/94682624 b/t/var/nntp-testers/94682624 new file mode 100644 index 0000000..9f56cb7 --- /dev/null +++ b/t/var/nntp-testers/94682624 @@ -0,0 +1,211 @@ +<!DOCTYPE html> + + + +<pre> +From: <strong>Chris Williams (BINGOS)</strong> +Subject: <strong>PASS CPAN-Testers-Common-Client-0.14 5.18.0 GNU/Linux</strong> +Date: <strong>2018-04-28T01:07:29Z</strong> + +This distribution has been tested as part of the CPAN Testers +project, supporting the Perl programming language. See +http://wiki.cpantesters.org/ for more information or email +questions to cpan-testers-discuss@perl.org + + +-- + +Dear GARU, + +This is a computer-generated error report created automatically by +CPANPLUS, version 0.9172. Testers personal comments may appear +at the end of this report. + + +Thank you for uploading your work to CPAN. Congratulations! +All tests were successful. + +TEST RESULTS: + +Below is the error stack from stage 'make test': + +PERL_DL_NONLAZY=1 "/home/cpan/pit/thr/perl-5.18.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t +# Testing CPAN::Testers::Common::Client 0.14 +t/00.load.t ................. ok +t/01-basic.t ................ ok +t/02-config.t ............... ok +t/03-history.t .............. ok +t/03-undef-prereq-report.t .. ok +All tests successful. +Files=5, Tests=96, 2 wallclock secs ( 0.02 usr 0.01 sys + 1.72 cusr 0.32 csys = 2.07 CPU) +Result: PASS + + +PREREQUISITES: + +Here is a list of prerequisites you specified and versions we +managed to load: + + Module Name Have Want + CPAN::Version 5.5001 0 + Capture::Tiny 0.48 0 + Carp 1.29 0 + Config::Perl::V 0.17 0 + Devel::Platform::Info 0.16 0 + ExtUtils::MakeMaker 7.34 6.36 + Fcntl 1.11 0 + File::Glob 1.20 0 + File::HomeDir 1.002 0.58 + File::Path 2.15 0 + File::Spec 3.74 3.19 + IO::File 1.16 0 + IPC::Cmd 1.00 0 + Probe::Perl 0.03 0 + Test::More 1.302135 0 + +Perl module toolchain versions installed: + Module Name Have + CPANPLUS 0.9172 + CPANPLUS::Dist::Build 0.88 + Cwd 3.74 + ExtUtils::CBuilder 0.280230 + ExtUtils::Command 7.34 + ExtUtils::Install 2.14 + ExtUtils::MakeMaker 7.34 + ExtUtils::Manifest 1.70 + ExtUtils::ParseXS 3.35 + File::Spec 3.74 + Module::Build 0.4224 + Pod::Parser 1.60 + Pod::Simple 3.28 + Test2 1.302135 + Test::Harness 3.42 + Test::More 1.302135 + version 0.9923 + +******************************** NOTE ******************************** +The comments above are created mechanically, possibly without manual +checking by the sender. As there are many people performing automatic +tests on each upload to CPAN, it is likely that you will receive +identical messages about the same problem. + +If you believe that the message is mistaken, please reply to the first +one with correction and/or additional informations, and do not take +it personally. We appreciate your patience. :) +********************************************************************** + +Additional comments: + + +This report was machine-generated by CPANPLUS::Dist::YACSmoke 1.02. +Powered by minismokebox version 0.68 + +------------------------------ +ENVIRONMENT AND OTHER CONTEXT +------------------------------ + +Environment variables: + + AUTOMATED_TESTING = 1 + LANG = en_GB.UTF-8 + LANGUAGE = en_GB:en + NONINTERACTIVE_TESTING = 1 + PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + PERL5LIB = :/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/3334083yrp/Capture-Tiny-0.48/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/3334083yrp/Capture-Tiny-0.48/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/RPT1VpoKLI/Devel-Platform-Info-0.16/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/RPT1VpoKLI/Devel-Platform-Info-0.16/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/dexgMr8p8Z/File-Which-1.22/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/dexgMr8p8Z/File-Which-1.22/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/wAET31H3Fo/File-HomeDir-1.002/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/wAET31H3Fo/File-HomeDir-1.002/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/OlNnhkJFiD/Probe-Perl-0.03/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/OlNnhkJFiD/Probe-Perl-0.03/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/7udoup7Uwj/CPAN-Testers-Common-Client-0.14/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/7udoup7Uwj/CPAN-Testers-Common-Client-0.14/blib/arch + PERL5_CPANPLUS_IS_RUNNING = 20512 + PERL5_CPANPLUS_IS_VERSION = 0.9172 + PERL5_MINISMOKEBOX = 0.68 + PERL5_YACSMOKE_BASE = /home/cpan/pit/thr/conf/perl-5.18.0 + PERL_EXTUTILS_AUTOINSTALL = --defaultdeps + PERL_MM_USE_DEFAULT = 1 + SHELL = /bin/bash + TERM = screen + +Perl special variables (and OS-specific diagnostics, for MSWin32): + + Perl: $^X = /home/cpan/pit/thr/perl-5.18.0/bin/perl + UID: $< = 1001 + EUID: $> = 1001 + GID: $( = 1001 1001 + EGID: $) = 1001 1001 + + +------------------------------- + + +-- + +Summary of my perl5 (revision 5 version 18 subversion 0) configuration: + + Platform: + osname=linux, osvers=4.4.0-21-generic, archname=x86_64-linux-thread-multi + uname='linux uchder 4.4.0-21-generic #37-ubuntu smp mon apr 18 18:33:37 utc 2016 x86_64 x86_64 x86_64 gnulinux ' + config_args='-des -Dprefix=/home/cpan/pit/thr/perl-5.18.0 -Dusethreads' + hint=recommended, useposix=true, d_sigaction=define + useithreads=define, usemultiplicity=define + useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef + use64bitint=define, use64bitall=define, uselongdouble=undef + usemymalloc=n, bincompat5005=undef + Compiler: + cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', + optimize='-O2', + cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' + ccversion='', gccversion='5.3.1 20160413', gccosandvers='' + intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 + d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 + ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 + alignbytes=8, prototype=define + Linker and Libraries: + ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' + libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib + libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat + perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc + libc=libc-2.23.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.23' + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' + cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' + + +Characteristics of this binary (from libperl): + Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS + PERL_DONT_CREATE_GVSV + PERL_HASH_FUNC_ONE_AT_A_TIME_HARD + PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP + PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL + USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES + USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE + USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF + USE_REENTRANT_API + Locally applied patches: + Devel::PatchPerl 1.42 + Built under linux + Compiled at May 2 2016 03:22:43 + %ENV: + PERL5LIB=":/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/3334083yrp/Capture-Tiny-0.48/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/3334083yrp/Capture-Tiny-0.48/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/RPT1VpoKLI/Devel-Platform-Info-0.16/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/RPT1VpoKLI/Devel-Platform-Info-0.16/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/dexgMr8p8Z/File-Which-1.22/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/dexgMr8p8Z/File-Which-1.22/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/wAET31H3Fo/File-HomeDir-1.002/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/wAET31H3Fo/File-HomeDir-1.002/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/OlNnhkJFiD/Probe-Perl-0.03/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/OlNnhkJFiD/Probe-Perl-0.03/blib/arch:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/7udoup7Uwj/CPAN-Testers-Common-Client-0.14/blib/lib:/home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/7udoup7Uwj/CPAN-Testers-Common-Client-0.14/blib/arch" + PERL5_CPANPLUS_IS_RUNNING="20512" + PERL5_CPANPLUS_IS_VERSION="0.9172" + PERL5_MINISMOKEBOX="0.68" + PERL5_YACSMOKE_BASE="/home/cpan/pit/thr/conf/perl-5.18.0" + PERL_EXTUTILS_AUTOINSTALL="--defaultdeps" + PERL_MM_USE_DEFAULT="1" + @INC: + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/3334083yrp/Capture-Tiny-0.48/blib/lib + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/3334083yrp/Capture-Tiny-0.48/blib/arch + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/RPT1VpoKLI/Devel-Platform-Info-0.16/blib/lib + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/RPT1VpoKLI/Devel-Platform-Info-0.16/blib/arch + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/dexgMr8p8Z/File-Which-1.22/blib/lib + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/dexgMr8p8Z/File-Which-1.22/blib/arch + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/wAET31H3Fo/File-HomeDir-1.002/blib/lib + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/wAET31H3Fo/File-HomeDir-1.002/blib/arch + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/OlNnhkJFiD/Probe-Perl-0.03/blib/lib + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/OlNnhkJFiD/Probe-Perl-0.03/blib/arch + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/7udoup7Uwj/CPAN-Testers-Common-Client-0.14/blib/lib + /home/cpan/pit/thr/conf/perl-5.18.0/.cpanplus/5.18.0/build/7udoup7Uwj/CPAN-Testers-Common-Client-0.14/blib/arch + /home/cpan/pit/thr/perl-5.18.0/lib/site_perl/5.18.0/x86_64-linux-thread-multi + /home/cpan/pit/thr/perl-5.18.0/lib/site_perl/5.18.0 + /home/cpan/pit/thr/perl-5.18.0/lib/5.18.0/x86_64-linux-thread-multi + /home/cpan/pit/thr/perl-5.18.0/lib/5.18.0 + . +</pre> + -- 2.11.4.GIT