diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index 2745d0c2..c02602f3 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -136,8 +136,9 @@ sub queue_summary :Local :Path('queue-summary') :Args(0) { $c->stash->{template} = 'queue-summary.tt'; $c->stash->{queued} = dbh($c)->selectall_arrayref( - "select project, jobset, count(*) as queued, min(timestamp) as oldest, max(timestamp) as newest from Builds " . - "where finished = 0 group by project, jobset order by queued desc", + "select jobsets.project as project, jobsets.name as jobset, count(*) as queued, min(timestamp) as oldest, max(timestamp) as newest from Builds " . + "join Jobsets jobsets on jobsets.id = builds.jobset_id " . + "where finished = 0 group by jobsets.project, jobsets.name order by queued desc", { Slice => {} }); $c->stash->{systems} = dbh($c)->selectall_arrayref( @@ -199,8 +200,10 @@ sub machines :Local Args(0) { $c->stash->{machines} = $machines; $c->stash->{steps} = dbh($c)->selectall_arrayref( - "select build, stepnr, s.system as system, s.drvpath as drvpath, machine, s.starttime as starttime, project, jobset, job, s.busy as busy " . - "from BuildSteps s join Builds b on s.build = b.id " . + "select build, stepnr, s.system as system, s.drvpath as drvpath, machine, s.starttime as starttime, jobsets.project, jobsets.name, job, s.busy as busy " . + "from BuildSteps s " . + "join Builds b on s.build = b.id " . + "join Jobsets jobsets on jobsets.id = b.jobset_id " . "where busy != 0 order by machine, stepnr", { Slice => {} }); $c->stash->{template} = 'machine-status.tt'; diff --git a/t/Hydra/Controller/Root/status.t b/t/Hydra/Controller/Root/status.t index 94aa17b0..1b53583e 100644 --- a/t/Hydra/Controller/Root/status.t +++ b/t/Hydra/Controller/Root/status.t @@ -23,11 +23,21 @@ my $jobset = createBaseJobset("basic", "basic.nix", $ctx{jobsdir}); ok(evalSucceeds($jobset), "Evaluating jobs/basic.nix should exit with return code 0"); +subtest "/machines" => sub { + my $response = request(GET '/machines'); + ok($response->is_success, "The page showing the machine status 200's."); +}; + subtest "/queue-runner-status" => sub { my $global = request(GET '/queue-runner-status'); ok($global->is_success, "The page showing the queue runner status 200's."); }; +subtest "/queue-summary" => sub { + my $response = request(GET '/queue-summary'); + ok($response->is_success, "The page showing the queue summary 200's."); +}; + subtest "/queue" => sub { my $response = request(GET '/queue', Accept => 'application/json'); ok($response->is_success, "The page showing the queue 200's.");