File Coverage

blib/lib/Tapper/Schema/TestrunDB/Result/View010TestrunOverviewReports.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Tapper::Schema::TestrunDB::Result::View010TestrunOverviewReports;
2             our $AUTHORITY = 'cpan:TAPPER';
3             # the number is to sort classes on deploy
4             $Tapper::Schema::TestrunDB::Result::View010TestrunOverviewReports::VERSION = '5.0.9';
5 7     7   3403 use 5.010;
  7         17  
6 7     7   25 use strict;
  7         10  
  7         111  
7 7     7   23 use warnings;
  7         8  
  7         145  
8              
9 7     7   24 use parent 'DBIx::Class::Core';
  7         57  
  7         35  
10              
11             __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
12              
13             __PACKAGE__->table('view_testrun_overview_reports');
14              
15             # virtual is needed when the query should accept parameters
16             __PACKAGE__->result_source_instance->is_virtual(0);
17             __PACKAGE__->result_source_instance->deploy_depends_on( [qw(Tapper::Schema::TestrunDB::Result::ReportgroupTestrun
18             Tapper::Schema::TestrunDB::Result::ReportgroupTestrunStats
19             )] );
20             __PACKAGE__->result_source_instance->view_definition
21             (
22             "select rgt.testrun_id as rgt_testrun_id ".
23             " , max(rgt.report_id) as primary_report_id ".
24             " , rgts.success_ratio as rgts_success_ratio ".
25             "from reportgrouptestrun rgt, ".
26             " reportgrouptestrunstats rgts ".
27             "where rgt.testrun_id=rgts.testrun_id ".
28             "group by rgt.testrun_id, rgts.success_ratio"
29             );
30              
31             __PACKAGE__->add_columns
32             (
33             'rgt_testrun_id' => { data_type => 'INT', },
34             'rgts_success_ratio' => { data_type => 'varchar', size => 20 },
35             'primary_report_id' => { data_type => 'INT' },
36             );
37              
38             1;
39              
40             __END__
41              
42             =pod
43              
44             =encoding UTF-8
45              
46             =head1 NAME
47              
48             Tapper::Schema::TestrunDB::Result::View010TestrunOverviewReports
49              
50             =head1 AUTHORS
51              
52             =over 4
53              
54             =item *
55              
56             AMD OSRC Tapper Team <tapper@amd64.org>
57              
58             =item *
59              
60             Tapper Team <tapper-ops@amazon.com>
61              
62             =back
63              
64             =head1 COPYRIGHT AND LICENSE
65              
66             This software is Copyright (c) 2017 by Advanced Micro Devices, Inc..
67              
68             This is free software, licensed under:
69              
70             The (two-clause) FreeBSD License
71              
72             =cut