NAME

CPAN::Testers::Schema::ResultSet::TestReport - Query the raw test reports

VERSION

version 0.028

SYNOPSIS

my $rs = $schema->resultset( 'TestReport' );
$rs->insert_metabase_fact( $fact );

DESCRIPTION

This object helps to insert and query the raw test reports.

METHODS

dist

my $rs = $rs->dist( 'Perl 5', 'CPAN-Testers-Schema' );
my $rs = $rs->dist( 'Perl 5', 'CPAN-Testers-Schema', '0.012' );

Fetch reports only for the given distribution, optionally for the given version. Returns a new CPAN::Testers::Schema::ResultSet::TestReport object that will only return reports with the given data.

This can be used to scan the full reports for specific data.

insert_metabase_fact

my $row = $rs->insert_metabase_fact( $fact );

Convert a CPAN::Testers::Report object to the new test report structure and insert it into the database. This is for creating backwards-compatible APIs.

convert_metabase_report

Convert a CPAN::Testers::Report object to the new test report structure and return the row object with id, created, and report fields. report is the canonical report schema as a Perl data structure.

parse_metabase_report

my $metabase_report = $rs->parse_metabase_report( $metabase_row );

This sub undoes the processing that CPAN Testers expects before it is put in the database so we can ensure that the report was submitted correctly.

This code is stolen from CPAN::Testers::Data::Generator sub load_fact.

$metabase_row is a hashref with the following keys:

fact        - A serialized CPAN::Testers::Fact::TestSummary (I think)
report      - A serialized CPAN::Testers::Fact::LegacyReport (I think)

SEE ALSO

CPAN::Testers::Schema::Result::TestReport, DBIx::Class::ResultSet, CPAN::Testers::Schema

AUTHORS

  • Oriol Soriano <oriolsoriano@gmail.com>

  • Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Oriol Soriano, Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.