forked from lix-project/hydra
Flesh out the API a bit
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
b51b8cddf4
commit
4eef090a45
|
@ -274,7 +274,7 @@ sub evals_GET {
|
|||
my $offset = ($page - 1) * $resultsPerPage;
|
||||
$c->stash->{evals} = getEvals($self, $c, $evals, $offset, $resultsPerPage);
|
||||
my %entity = (
|
||||
evals => $c->stash->{evals},
|
||||
evals => [ map { $_->{eval} } @{$c->stash->{evals}} ],
|
||||
first => "?page=1",
|
||||
last => "?page=" . POSIX::ceil($c->stash->{total}/$resultsPerPage)
|
||||
);
|
||||
|
|
|
@ -606,6 +606,7 @@ my %hint = (
|
|||
'id',
|
||||
'finished',
|
||||
'timestamp',
|
||||
'starttime',
|
||||
'stoptime',
|
||||
'project',
|
||||
'jobset',
|
||||
|
|
|
@ -171,7 +171,9 @@ __PACKAGE__->belongs_to(
|
|||
|
||||
my %hint = (
|
||||
columns => [
|
||||
"revision"
|
||||
"revision",
|
||||
"type",
|
||||
"uri"
|
||||
],
|
||||
);
|
||||
|
||||
|
|
|
@ -309,6 +309,12 @@ __PACKAGE__->has_many(
|
|||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DTAGxP5RFvcNxP/ciJGo4Q
|
||||
|
||||
my %hint = (
|
||||
columns => [
|
||||
"enabled",
|
||||
"errormsg",
|
||||
"fetcherrormsg",
|
||||
"emailoverride"
|
||||
],
|
||||
eager_relations => {
|
||||
jobsetinputs => "name"
|
||||
}
|
||||
|
|
|
@ -51,14 +51,14 @@ $result = request_json({ uri => '/jobset/sample/default/evals' });
|
|||
ok($result->code() == 200, "Can get evals of a jobset");
|
||||
my $evals = decode_json($result->content())->{evals};
|
||||
my $eval = $evals->[0];
|
||||
ok($eval->{eval}->{hasnewbuilds} == 1, "The first eval of a jobset has new builds");
|
||||
ok($eval->{hasnewbuilds} == 1, "The first eval of a jobset has new builds");
|
||||
|
||||
# Ugh, cached for 30s
|
||||
sleep 30;
|
||||
system("echo >> /run/jobset/default.nix; LOGNAME=root NIX_STORE_DIR=/run/nix/store NIX_LOG_DIR=/run/nix/var/log/nix NIX_STATE_DIR=/run/nix/var/nix HYDRA_DATA=/var/lib/hydra HYDRA_DBI='dbi:Pg:dbname=hydra;user=root;' hydra-evaluator sample default");
|
||||
my $evals = decode_json(request_json({ uri => '/jobset/sample/default/evals' })->content())->{evals};
|
||||
ok($evals->[0]->{eval}->{jobsetevalinputs}->{"my-src"}->{revision} != $evals->[1]->{eval}->{jobsetevalinputs}->{"my-src"}->{revision}, "Changing a jobset source changes its revision");
|
||||
ok($evals->[0]->{jobsetevalinputs}->{"my-src"}->{revision} != $evals->[1]->{jobsetevalinputs}->{"my-src"}->{revision}, "Changing a jobset source changes its revision");
|
||||
|
||||
my $build = decode_json(request_json({ uri => "/build/" . $evals->[0]->{eval}->{builds}->[0] })->content());
|
||||
my $build = decode_json(request_json({ uri => "/build/" . $evals->[0]->{builds}->[0] })->content());
|
||||
ok($build->{job} eq "job", "The build's job name is job");
|
||||
ok($build->{finished} == 0, "The build isn't finished yet");
|
||||
|
|
Loading…
Reference in a new issue