blib/lib/HPC/Runner/Command/execute_job/Utils/Plugin.pm

filter: Statementstmt 55.0% 11 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 2 / 6 Podpod 100% 1 / 1 totaltotal 45.1% 14 / 31 CC 3 SCAR 13.2
CC
3
Cov
46%
job_load_plugins
6.0
__ANON__
6.0
__ANON__
2.0
CRAP 3.8
« blib/lib/HPC/Runner/Command/submit_jobs/Utils/Scheduler/JobStats.pm ↑ Summary blib/lib/HPC/Runner/Command/stats/Logger/JSON/JSONOutput.pm »
1 package HPC::Runner::Command::execute_job::Utils::Plugin;
2  
3 1 ▶use MooseX::App::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 with 'MooseX::Object::Pluggable';
7  
8 =head3 job_plugins
9  
10 Load job execution plugins
11  
12 =cut
13  
14 option 'job_plugins' => (
15 traits => ['Array'],
16 is => 'rw',
17 isa => 'ArrayRef[Str]',
18 documentation => 'Load job execution plugins',
19 cmd_split => qr/,/,
20 required => 0,
21 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 1 handles => {
23 has_job_plugins => 'count',
24 join_job_plugins => 'join',
25 },
26 );
27  
28 option 'job_plugins_opts' => (
29 is => 'rw',
30 isa => 'HashRef',
31 documentation => 'Options for job_plugins',
32 required => 0,
33 0 ▶ default => sub { {} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
34 1 );
35  
36 =head2 Subroutines
37  
38 =head3 job_load_plugins
39  
40 =cut
41  
42 sub job_load_plugins {
43 0 ▶ my $self = shift;
Subroutine job_load_plugins: not called CC=2 SCAR=17.9
Pod documented
44  
45 0 ▶ return unless $self->job_plugins;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->job_plugins 0 0 0
46  
47 0 $self->app_load_plugins( $self->job_plugins );
48 0 $self->parse_plugin_opts( $self->job_plugins_opts );
49 }
50  
51 =head3 after *load_plugins
52  
53 After loading the plugins make sure to reload the configs - to get any options we didn't get the first time around
54  
55 =cut
56  
57 after 'job_load_plugins' => sub {
58 0 ▶ my $self = shift;
Subroutine __ANON__: not called CC=2 SCAR=17.9
59  
60 0 ▶ if ( $self->has_config_files ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_config_files) 0 0 0
61 0 $self->load_configs;
62 }
63 1 };
64  
65 1 1;
« blib/lib/HPC/Runner/Command/submit_jobs/Utils/Scheduler/JobStats.pm ↑ Summary blib/lib/HPC/Runner/Command/stats/Logger/JSON/JSONOutput.pm »