forked from lix-project/hydra
Merge pull request #1078 from DeterminateSystems/fixup-queue-runner-status
queue-runner-status: fixup from perlcritic-level-2
This commit is contained in:
commit
cf6f78c365
|
@ -168,7 +168,7 @@ sub queue_runner_status_GET {
|
||||||
my ($self, $c) = @_;
|
my ($self, $c) = @_;
|
||||||
|
|
||||||
#my $status = from_json($c->model('DB::SystemStatus')->find('queue-runner')->status);
|
#my $status = from_json($c->model('DB::SystemStatus')->find('queue-runner')->status);
|
||||||
my $status = from_json(`hydra-queue-runner --status`);
|
my $status = decode_json(`hydra-queue-runner --status`);
|
||||||
if ($?) { $status->{status} = "unknown"; }
|
if ($?) { $status->{status} = "unknown"; }
|
||||||
my $json = JSON->new->pretty()->canonical();
|
my $json = JSON->new->pretty()->canonical();
|
||||||
|
|
||||||
|
|
30
t/Controller/Root/queue-runner-status.t
Normal file
30
t/Controller/Root/queue-runner-status.t
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Setup;
|
||||||
|
use Data::Dumper;
|
||||||
|
my %ctx = test_init();
|
||||||
|
|
||||||
|
require Hydra::Schema;
|
||||||
|
require Hydra::Model::DB;
|
||||||
|
require Hydra::Helper::Nix;
|
||||||
|
|
||||||
|
use Test2::V0;
|
||||||
|
require Catalyst::Test;
|
||||||
|
use HTTP::Request::Common;
|
||||||
|
Catalyst::Test->import('Hydra');
|
||||||
|
|
||||||
|
my $db = Hydra::Model::DB->new;
|
||||||
|
hydra_setup($db);
|
||||||
|
|
||||||
|
my $project = $db->resultset('Projects')->create({name => "tests", displayname => "", owner => "root"});
|
||||||
|
|
||||||
|
my $jobset = createBaseJobset("basic", "basic.nix", $ctx{jobsdir});
|
||||||
|
|
||||||
|
ok(evalSucceeds($jobset), "Evaluating jobs/basic.nix should exit with return code 0");
|
||||||
|
|
||||||
|
subtest "/queue-runner-status" => sub {
|
||||||
|
my $global = request(GET '/queue-runner-status');
|
||||||
|
ok($global->is_success, "The page showing the the queue runner status 200's.");
|
||||||
|
};
|
||||||
|
|
||||||
|
done_testing;
|
Loading…
Reference in a new issue