From 2582a8880b03ed6f2067b479bba8a54e4d0e9fc1 Mon Sep 17 00:00:00 2001 From: Andreas Koenig Date: Tue, 29 Oct 2013 10:08:25 +0100 Subject: [PATCH] add name of failing tests to extract variables as fail:$path=$number_of_tests --- MANIFEST | 1 + lib/CPAN/Testers/ParseReport.pm | 38 ++++-- t/ctgetreports.t | 25 +++- t/ctgr-live.t | 2 +- t/var/nntp-testers/34604012 | 248 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 302 insertions(+), 12 deletions(-) create mode 100644 t/var/nntp-testers/34604012 diff --git a/MANIFEST b/MANIFEST index ae39e0b..b44bdb7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -153,6 +153,7 @@ t/var/nntp-testers/2400137 t/var/nntp-testers/2410530 t/var/nntp-testers/2427559 t/var/nntp-testers/2433487 +t/var/nntp-testers/34604012 t/var/nntp-testers/3521214 t/var/nntp-testers/3851138 t/var/nntp-testers/5012315 diff --git a/lib/CPAN/Testers/ParseReport.pm b/lib/CPAN/Testers/ParseReport.pm index e8275cb..3556c20 100644 --- a/lib/CPAN/Testers/ParseReport.pm +++ b/lib/CPAN/Testers/ParseReport.pm @@ -483,6 +483,7 @@ sub parse_report { my $in_summary_seen_platform = 0; my $in_prg_output = 0; my $in_env_context = 0; + my $in_test_summary = 0; my $current_headline; my @previous_line = ""; # so we can neutralize line breaks @@ -512,18 +513,23 @@ sub parse_report { $followupline =~ s/^\s+//; # remo leading space $_ .= $followupline; } - if (/^--------/ && $previous_line[-2] && $previous_line[-2] =~ /^--------/) { - $current_headline = $previous_line[-1]; - if ($current_headline =~ /PROGRAM OUTPUT/) { - $in_prg_output = 1; - } else { + if (/^--------/) { + if ($previous_line[-2] && $previous_line[-2] =~ /^--------/) { + $current_headline = $previous_line[-1]; + if ($current_headline =~ /PROGRAM OUTPUT/) { + $in_prg_output = 1; + } else { + $in_prg_output = 0; + } + if ($current_headline =~ /ENVIRONMENT AND OTHER CONTEXT/) { + $in_env_context = 1; + } else { + $in_env_context = 0; + } + } elsif ($previous_line[-1] && $previous_line[-1] =~ /Test Summary Report/) { + $in_test_summary = 1; $in_prg_output = 0; } - if ($current_headline =~ /ENVIRONMENT AND OTHER CONTEXT/) { - $in_env_context = 1; - } else { - $in_env_context = 0; - } } if ($extract{"meta:perl"}) { if ( $in_summary @@ -702,6 +708,18 @@ sub parse_report { } } } + if ($in_test_summary) { + $DB::single=1; + if (/^(?:Result:|Files=\d)/) { + $in_test_summary = 0; + } elsif (/^(\S+)\s+\(Wstat:.+?Tests:.+?Failed:\s*(\d+)\)$/) { + my $in_test_summary_current_test = $1; + my $in_test_summary_current_failed = $2; + $extract{"fail:$in_test_summary_current_test"} = $in_test_summary_current_failed; + } elsif (/^\s+Failed tests?:/) { + # ignoring the exact combination of tests for now, seems like overkill + } + } push @previous_line, $_; if ($expect_prereq || $expect_toolchain) { if (/Perl module toolchain versions installed/) { diff --git a/t/ctgetreports.t b/t/ctgetreports.t index 1cecd5f..dca4ed4 100644 --- a/t/ctgetreports.t +++ b/t/ctgetreports.t @@ -246,7 +246,7 @@ sub reportedvariableis ($$$$) { push @full, $_; } close $fh or diag join "", @full; - is "@reg", "meta:writer mod:Test::Harness id", "found the top 3 candidates"; + is "@reg", "fail:t/04-fork meta:writer mod:Test::Harness", "found the top 3 candidates"; # Up to 0.0.15: @@ -427,6 +427,28 @@ sub reportedvariableis ($$$$) { BEGIN { $plan += 1; } + my $id = 34604012; + my %Opt = ( + 'local' => 1, + 'cachedir' => 't/var', + 'quiet' => 1, + 'dumpvars' => ".", + 'report' => $id, + ); + my $dumpvars = {}; + my $extract = CPAN::Testers::ParseReport::parse_report + ( + "t/var/nntp-testers/$id", + $dumpvars, + %Opt, + ); + is $extract->{'fail:t/20-content-types.t'}, 1; +} + +{ + BEGIN { + $plan += 2; + } my $id = 6422067; my %Opt = ( 'local' => 1, @@ -444,6 +466,7 @@ sub reportedvariableis ($$$$) { %Opt, ); is $extract->{'qr:(Failed test\s+\S+.*)'}, q{Failed test 'Pod coverage on App::Pm2Port'}, "report $id: qr...Failed test..."; + is $extract->{'fail:t/pod-coverage.t'}, 1; } { diff --git a/t/ctgr-live.t b/t/ctgr-live.t index 87ea94e..b4223c6 100644 --- a/t/ctgr-live.t +++ b/t/ctgr-live.t @@ -38,7 +38,7 @@ my $plan; my $duration = time - $start; @reg = sort @reg; # make it a bit less fragile is "@reg", - "conf:archname conf:archname+osvers conf:ldflags", + "conf:archname+osvers conf:ldflags fail:t/01-mmmdelicious.t", "found the 'right' top 3 candidates in $duration seconds; (a very fragile test)"; } diff --git a/t/var/nntp-testers/34604012 b/t/var/nntp-testers/34604012 new file mode 100644 index 0000000..21d965e --- /dev/null +++ b/t/var/nntp-testers/34604012 @@ -0,0 +1,248 @@ + + + + + + +CPAN Testers Reports: Report for MojoX-DirectoryListing-0.04 + + + + + + + + + + + + + + + + + + + + +
+From: "Chris Williams (BINGOS)" <chris [at] bingosnet [dot] co [dot] uk>
+Subject: FAIL MojoX-DirectoryListing-0.04 v5.12.0 FreeBSD
+Date: 2013-09-22T21:52:18Z
+
+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 MOB,
+
+This is a computer-generated error report created automatically by
+CPANPLUS, version 0.9142. Testers personal comments may appear
+at the end of this report.
+
+
+Thank you for uploading your work to CPAN.  However, it appears that
+there were some problems testing your distribution.
+
+TEST RESULTS:
+
+Below is the error stack from stage 'make test':
+
+PERL_DL_NONLAZY=1 /usr/home/cpan/pit/bare-clang/perl-5.12.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
+# Testing MojoX::DirectoryListing 0.04, Perl 5.012000, /usr/home/cpan/pit/bare-clang/perl-5.12.0/bin/perl
+t/00-load.t ........... ok
+# building test filesystem
+# tearing down test filesystem
+t/10-app1.t ........... ok
+# building test filesystem
+
+#   Failed test 'Content-Type: text/plain'
+#   at t/20-content-types.t line 59.
+#          got: 'text/plain;charset=UTF-8'
+#     expected: 'text/plain'
+# tearing down test filesystem
+# Looks like you failed 1 test of 22.
+t/20-content-types.t .. 
+Dubious, test returned 1 (wstat 256, 0x100)
+Failed 1/22 subtests 
+# building test filesystem
+# tearing down test filesystem
+t/30-stylesheets.t .... ok
+# building test filesystem
+# tearing down test filesystem
+t/31-header-footer.t .. ok
+# building test filesystem
+# tearing down test filesystem
+t/60-icons.t .......... ok
+
+Test Summary Report
+-------------------
+t/20-content-types.t (Wstat: 256 Tests: 22 Failed: 1)
+  Failed test:  13
+  Non-zero exit status: 1
+Files=6, Tests=248,  6 wallclock secs ( 0.05 usr  0.02 sys +  1.49 cusr  0.31 csys =  1.88 CPU)
+Result: FAIL
+Failed 1/6 test programs. 1/248 subtests failed.
+*** [test_dynamic] Error code 255
+
+Stop in /usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/MojoX-DirectoryListing-0.04.
+
+
+PREREQUISITES:
+
+Here is a list of prerequisites you specified and versions we
+managed to load:
+
+	  Module Name                        Have     Want
+	  Mojolicious::Lite                     0        0
+	  Test::Mojo                            0        0
+	  Test::More                         0.98        0
+
+Perl module toolchain versions installed:
+	Module Name                        Have
+	CPANPLUS                         0.9142
+	CPANPLUS::Dist::Build              0.70
+	Cwd                                3.40
+	ExtUtils::CBuilder             0.280212
+	ExtUtils::Command                  1.16
+	ExtUtils::Install                  1.55
+	ExtUtils::MakeMaker                6.76
+	ExtUtils::Manifest                 1.63
+	ExtUtils::ParseXS                  3.22
+	File::Spec                         3.40
+	Module::Build                    0.4007
+	Pod::Parser                        1.37
+	Pod::Simple                        3.13
+	Test::Harness                      3.28
+	Test::More                         0.98
+	version                          0.9904
+
+******************************** 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 0.90.
+Powered by minismokebox version 0.56
+
+------------------------------
+ENVIRONMENT AND OTHER CONTEXT
+------------------------------
+
+Environment variables:
+
+    AUTOMATED_TESTING = 1
+    NONINTERACTIVE_TESTING = 1
+    PATH = /usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/Mojolicious-4.41/blib/script:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/cpan/bin
+    PERL5LIB = :/usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/Mojolicious-4.41/blib/lib:/usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/Mojolicious-4.41/blib/arch:/usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/MojoX-DirectoryListing-0.04/blib/lib:/usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/MojoX-DirectoryListing-0.04/blib/arch
+    PERL5_CPANPLUS_IS_RUNNING = 11518
+    PERL5_CPANPLUS_IS_VERSION = 0.9142
+    PERL5_MINISMOKEBOX = 0.56
+    PERL5_YACSMOKE_BASE = /usr/home/cpan/pit/bare-clang/conf/perl-5.12.0
+    PERL_EXTUTILS_AUTOINSTALL = --defaultdeps
+    PERL_MM_USE_DEFAULT = 1
+    SHELL = /usr/local/bin/bash
+    TERM = screen
+
+Perl special variables (and OS-specific diagnostics, for MSWin32):
+
+    Perl: $^X = /usr/home/cpan/pit/bare-clang/perl-5.12.0/bin/perl
+    UID:  $<  = 1002
+    EUID: $>  = 1002
+    GID:  $(  = 1002 1002
+    EGID: $)  = 1002 1002
+
+
+-------------------------------
+
+
+--
+
+Summary of my perl5 (revision 5 version 12 subversion 0) configuration:
+   
+  Platform:
+    osname=freebsd, osvers=9.1-release, archname=amd64-freebsd
+    uname='freebsd fremen 9.1-release freebsd 9.1-release #0 r243825: tue dec 4 09:23:10 utc 2012 root@farrell.cse.buffalo.edu:usrobjusrsrcsysgeneric amd64 '
+    config_args='-des -Dprefix=/usr/home/cpan/pit/bare-clang/perl-5.12.0 -Dcc=clang'
+    hint=recommended, useposix=true, d_sigaction=define
+    useithreads=undef, usemultiplicity=undef
+    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
+    use64bitint=define, use64bitall=define, uselongdouble=undef
+    usemymalloc=n, bincompat5005=undef
+  Compiler:
+    cc='clang', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
+    optimize='-O',
+    cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
+    ccversion='', gccversion='4.2.1 Compatible FreeBSD Clang 3.1 ((branches/release_31 156863))', 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='clang', ldflags ='-Wl,-E  -fstack-protector -L/usr/local/lib'
+    libpth=/usr/lib /usr/local/lib
+    libs=-lgdbm -lm -lcrypt -lutil -lc
+    perllibs=-lm -lcrypt -lutil -lc
+    libc=, so=so, useshrplib=false, libperl=libperl.a
+    gnulibc_version=''
+  Dynamic Linking:
+    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
+    cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib -fstack-protector'
+
+
+Characteristics of this binary (from libperl): 
+  Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL
+                        USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO
+                        USE_PERL_ATOF
+  Built under freebsd
+  Compiled at Dec 20 2012 12:34:23
+  %ENV:
+    PERL5LIB=":/usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/Mojolicious-4.41/blib/lib:/usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/Mojolicious-4.41/blib/arch:/usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/MojoX-DirectoryListing-0.04/blib/lib:/usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/MojoX-DirectoryListing-0.04/blib/arch"
+    PERL5_CPANPLUS_IS_RUNNING="11518"
+    PERL5_CPANPLUS_IS_VERSION="0.9142"
+    PERL5_MINISMOKEBOX="0.56"
+    PERL5_YACSMOKE_BASE="/usr/home/cpan/pit/bare-clang/conf/perl-5.12.0"
+    PERL_EXTUTILS_AUTOINSTALL="--defaultdeps"
+    PERL_MM_USE_DEFAULT="1"
+  @INC:
+    /usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/Mojolicious-4.41/blib/lib
+    /usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/Mojolicious-4.41/blib/arch
+    /usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/MojoX-DirectoryListing-0.04/blib/lib
+    /usr/home/cpan/pit/bare-clang/conf/perl-5.12.0/.cpanplus/5.12.0/build/MojoX-DirectoryListing-0.04/blib/arch
+    /usr/home/cpan/pit/bare-clang/perl-5.12.0/lib/site_perl/5.12.0/amd64-freebsd
+    /usr/home/cpan/pit/bare-clang/perl-5.12.0/lib/site_perl/5.12.0
+    /usr/home/cpan/pit/bare-clang/perl-5.12.0/lib/5.12.0/amd64-freebsd
+    /usr/home/cpan/pit/bare-clang/perl-5.12.0/lib/5.12.0
+    .
+ + + + \ No newline at end of file -- 2.11.4.GIT