File Coverage

blib/lib/Tapper/Schema/TestrunDB/Result/View020TestrunOverview.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::View020TestrunOverview;
2             our $AUTHORITY = 'cpan:TAPPER';
3             # the number is to sort classes on deploy
4             $Tapper::Schema::TestrunDB::Result::View020TestrunOverview::VERSION = '5.0.11';
5 7     7   3479 use 5.010;
  7         25  
6 7     7   84 use strict;
  7         16  
  7         132  
7 7     7   31 use warnings;
  7         14  
  7         165  
8              
9 7     7   35 use parent 'DBIx::Class::Core';
  7         13  
  7         36  
10              
11             __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
12              
13             __PACKAGE__->table('view_testrun_overview');
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::View010TestrunOverviewReports
18             Tapper::Schema::TestrunDB::Result::Report
19             Tapper::Schema::TestrunDB::Result::Suite
20             )] );
21             __PACKAGE__->result_source_instance->view_definition
22             (
23             "select vtor.primary_report_id as vtor_primary_report_id ".
24             " , vtor.rgt_testrun_id as vtor_rgt_testrun_id ".
25             " , vtor.rgts_success_ratio as vtor_rgts_success_ratio ".
26             " , report.id as report_id ".
27             " , report.machine_name as report_machine_name ".
28             " , report.created_at as report_created_at ".
29             " , report.suite_id as report_suite_id ".
30             " , suite.name as report_suite_name ".
31             "from view_testrun_overview_reports vtor, ".
32             " report report, ".
33             " suite suite ".
34             "where CAST(vtor.primary_report_id as UNSIGNED INTEGER)=report.id and ".
35             " report.suite_id=suite.id"
36             );
37              
38             __PACKAGE__->add_columns
39             (
40             # view_testrun_overview_reports
41             'vtor_primary_report_id' => { data_type => 'INT', size => 11 },
42             'vtor_rgt_testrun_id' => { data_type => 'INT', size => 11 },
43             'vtor_rgts_success_ratio' => { data_type => 'varchar', size => 20 },
44             # report
45             'report_id' => { data_type => 'INT', size => 11 },
46             'report_machine_name' => { data_type => 'varchar', size => 50 },
47             'report_created_at' => { data_type => 'DATETIME' },
48             # suite
49             'report_suite_id' => { data_type => 'INT', size => 11 },
50             'report_suite_name' => { data_type => 'varchar', size => 255 },
51             );
52              
53             1;
54              
55             __END__
56              
57             =pod
58              
59             =encoding UTF-8
60              
61             =head1 NAME
62              
63             Tapper::Schema::TestrunDB::Result::View020TestrunOverview
64              
65             =head1 AUTHORS
66              
67             =over 4
68              
69             =item *
70              
71             AMD OSRC Tapper Team <tapper@amd64.org>
72              
73             =item *
74              
75             Tapper Team <tapper-ops@amazon.com>
76              
77             =back
78              
79             =head1 COPYRIGHT AND LICENSE
80              
81             This software is Copyright (c) 2019 by Advanced Micro Devices, Inc..
82              
83             This is free software, licensed under:
84              
85             The (two-clause) FreeBSD License
86              
87             =cut