Make the outputs' outpaths available via the Build JSON API

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-10-29 14:41:48 -04:00
parent 4eef090a45
commit 5da3dcfd57
3 changed files with 15 additions and 3 deletions

View file

@ -97,6 +97,14 @@ __PACKAGE__->belongs_to(
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-06-13 01:54:50
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:V8MbzKvZNEaeHBJV67+ZMQ
my %hint = (
columns => [
'path'
],
);
sub json_hint {
return \%hint;
}
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;

View file

@ -617,7 +617,10 @@ my %hint = (
'busy',
'buildstatus',
'releasename'
]
],
eager_relations => {
buildoutputs => 'name'
}
);
sub json_hint {

View file

@ -1,6 +1,6 @@
use LWP::UserAgent;
use JSON;
use Test::Simple tests => 15;
use Test::Simple tests => 16;
my $ua = LWP::UserAgent->new;
$ua->cookie_jar({});
@ -62,3 +62,4 @@ ok($evals->[0]->{jobsetevalinputs}->{"my-src"}->{revision} != $evals->[1]->{jobs
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");
ok($build->{buildoutputs}->{out}->{path} =~ /^\/run\/nix\/store\/[a-zA-Z0-9]{32}-job$/, "The build's outpath is in the nix store and named 'job'");