Ordo/Command/Cluster/Run.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 45 CC 2 SCAR 10.3
CC
2
Cov
0%
execute
6.0
name
2.0
summary
2.0
CRAP 2.8
1 package App::Ordo::Command::Cluster::Run;
2 use Moo;
3 use feature qw(say);
4 extends 'App::Ordo::Command::Base';
5 use Term::ANSIColor qw(colored);
6  
7 use App::Ordo qw($CURRENT_PATH);
8  
9 sub name { "cluster run" }
10 sub summary { "Run all jobs in a cluster (in dependency order)" }
11 sub usage { "<path>" }
12  
13 sub option_spec { {} }
14  
15 sub execute {
16 my ($self, $opt, $path) = @_;
17  
18 #unless ($path) {
19 # say colored(["bold red"], "Usage: cluster run <path>");
20 # return;
21 #}
22  
23 my $res = $self->api->call('start_cluster', { name => $path });
24  
25 if ($res->{success}) {
26 say colored(["bold green"], "Cluster started");
27 } else {
28 say colored(["bold red"], "Failed to start cluster: " . ($res->{message} || 'not found'));
29 }
30 }
31  
32 1;