sedusedan has asked for the wisdom of the Perl Monks concerning the following question:

I wonder if there is a way to list all (or all recent) reports from a particular test machine, to be able to find out if there is something strange/particular about the machine's setup.

Without having to download the whole SQLite database, that is.

  • Comment on CPANTester: finding reports for a particular test machine

Replies are listed 'Best First'.
Re: CPANTester: finding reports for a particular test machine
by kcott (Archbishop) on Jun 14, 2012 at 06:46 UTC

    I was curious about this but couldn't see a way to filter specific machines using the web interface. The CPAN Testers Reports page has download links for JSON, RSS and YAML. I downloaded the JSON data and wrote this quick-and-dirty script:

    #!/usr/bin/env perl use 5.010; use strict; use warnings; use JSON; my ($json_file, %json_wanted) = @ARGV; open my $json_fh, '<', $json_file or die "Can't open $json_file: $!"; my $json_text = <$json_fh>; close $json_fh; my $json_array_ref = decode_json $json_text; TEST_HASH: for my $test_hash (@$json_array_ref) { for my $wanted_key (keys %json_wanted) { my $test_value = $test_hash->{$wanted_key}; next TEST_HASH unless defined $test_value; next TEST_HASH unless "$json_wanted{$wanted_key}" eq "$test_va +lue"; } for my $key (sort keys %$test_hash) { say $key, ': ', $test_hash->{$key}; } say '-' x 60; }

    Here's a test run filtering on a specific tester and a specific Perl version:

    $ pm_cpan_test_extract.pl Tk-ROSyntaxText.json tester 'was_a_real_emai +l_address' perl '5.17.0' csspatch: unp cssperl: dev dist: Tk-ROSyntaxText distribution: Tk-ROSyntaxText distversion: Tk-ROSyntaxText-1.001 fulldate: 201205260128 guid: 0bf30766-a6d2-11e1-88ae-fe3ff4b14d39 id: 22275926 osname: linux ostext: GNU/Linux osvers: 2.6.32-5-amd64 perl: 5.17.0 platform: x86_64-linux-ld postdate: 201205 state: pass status: PASS tester: was_a_real_email_address type: 2 version: 1.001 ------------------------------------------------------------ csspatch: unp cssperl: dev dist: Tk-ROSyntaxText distribution: Tk-ROSyntaxText distversion: Tk-ROSyntaxText-1.001 fulldate: 201205220052 guid: 77d0ff9c-a3a8-11e1-8aed-c04af4b14d39 id: 22217880 osname: linux ostext: GNU/Linux osvers: 2.6.32-5-amd64 perl: 5.17.0 platform: x86_64-linux-thread-multi postdate: 201205 state: pass status: PASS tester: was_a_real_email_address type: 2 version: 1.001 ------------------------------------------------------------

    I changed the tester's email address to was_a_real_email_address before posting here. Use http://stats.cpantesters.org/cpanmail.html if you're really that interested. :-)

    I saw Khen1950fx's response as I was about to post this. I'm not familiar with the module he's used. Perhaps that's a better solution.

    -- Ken

      I think that your solution presents the info better. I upvoted your node++.

        Thanks for that; especially as that vote not only ++node but also ++level. I've just been promoted to Priest. :-)

        -- Ken

Re: CPANTester: finding reports for a particular test machine
by Khen1950fx (Canon) on Jun 14, 2012 at 05:41 UTC
    You could use CPAN::Testers::WWW::Reports::Query::Reports.
    #!/usr/bin/perl BEGIN { $| = 1; } use strict; use warnings; use CPAN::Testers::WWW::Reports::Query::Reports; my $query = CPAN::Testers::WWW::Reports::Query::Reports->new; exit unless ($query); my $result = $query->range( '20080300' ); my @ids = sort keys %$result; my $id = $ids[0]; binmode STDOUT, ":encoding(UTF-8)"; print "id = $id, dist = 'result->{$id}{'dist'}', version = 'result->{$id}{'version'}'"; if (defined(my $data = $query->raw)) { chomp $data; print $data, "\n"; } my $error = $query->error;
Re: CPANTester: finding reports for a particular test machine
by Anonymous Monk on Jun 14, 2012 at 06:16 UTC

    I wonder if there is a way to list all (or all recent) reports from a particular test machine, to be able to find out if there is something strange/particular about the machine's setup.

    What module?

    All the reports will have mostly the same information, ie, you won't be able to find anything