004';
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::HashBas
ntent_type($ct);
if ($ct eq 'application/json') {
$res->raw_body($data);
}
else {
$res->raw_body("<pre>" . encode_pretty_json($data) . "</pre>");
}
return $res;
}
.000004';
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::HashBase;
ntent_type => 'application/x-jsonl',
done => sub { !@$data },
fetch => sub {
my $item = shift @$data or return;
return encode_json($item) . "\n";
},
ke_uuid/;
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json/;
use JSON::PP();
use Carp qw/croak/;
use parent 'App::Yath::Server::Controller';
use Test2::H
eam(
env => $req->env,
cache => $cache,
content_type => 'application/x-jsonl; charset=utf-8',
done => sub {
my @keep;
while (my $set = shift
: 0 },
sub {
my $update = JSON::PP::false;
if ($sig) {
$it->discard_changes;
$update = JSON::PP::true;
}
my $ne
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json decode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::
unless $run;
my $data = $run->rerun_data;
$res->content_type('application/json');
$res->raw_body($data);
return $res;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
hare_dir/;
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::HashBase
1});
}
elsif ($act eq 'parameters') {
$res->content_type('application/json');
$res->raw_body($run->parameters);
return $res;
}
elsif
) if $run->pinned;
$run->delete;
}
}
$res->content_type('application/json');
$res->raw_body($run);
return $res;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
_and_try/;
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::HashBase q
job->name) . ' - ' . $job->job_id . '+' . $try->job_try_ord;
$res->content_type('application/json');
$res->raw_body({job => $job, try => $try});
return $res;
}
1;
__END__
=pod
=encodi
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json decode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::
tent_type => 'application/x-jsonl; charset=utf-8',
cache => 0,
headers => ["content-disposition" => 'attachment; filename="coverage.jsonl"'],
done => s
fetch => sub {
if (my $item = $iter->()) {
return encode_json($item) . "\n";
}
else {
$done = 1;
h::Util qw/share_dir/;
use App::Yath::Schema::Util qw/find_job/;
use Test2::Harness::Util::JSON qw/encode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::HashBase qw/-ti
out;
$res->stream(
env => $req->env,
content_type => 'application/x-jsonl; charset=utf-8',
done => sub {
return 0 if @out;
return 0 if @s
$run = $rs->find_by_id_or_uuid($lookup);
return () unless $run;
return (
encode_json({type => 'run', data => $run }) . "\n",
);
}
sub lookup_job {
my $self = shift;
my (
est_name/;
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::HashBase;
my $json = $req->content;
my $stats = decode_json($json);
my $res = resp(200);
$res->stream(
env => $req->env,
content_type => 'application/x-jsonl; charse
{
my $data = $self->build_stat($project => shift(@$stats));
return encode_json($data) . "\n";
},
);
return $res;
}
my %VALID_TYPES = (
run_list
l qw/max/;
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::HashBase;
event_id']};
if ($route->{from} eq 'single_event') {
$res->content_type('application/json');
$res->raw_body($event);
return $res;
}
if ($p->{load_subtests}) {
);
$res->stream(
env => $req->env,
content_type => 'application/x-jsonl; charset=utf-8',
resultset => $rs,
data_method => 'st_line_data',
);
/find_job/;
use App::Yath::Schema::DateTimeFormat qw/DTF/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Util::Times qw/render_duration/;
use parent 'App::Yath::Server::Contr
h->execute($run->run_id, $ord);
return {ord => $ord, resources => [map { $_->{data} = decode_json($_->{data}); $_ } @{$sth->fetchall_arrayref({})}]};
}
sub res_ord {
my $self = shift;
my
ata = $self->get_up_to($run, $ord);
my $res = resp(200);
$res->content_type('application/json');
$res->raw_body($data);
return $res;
}
sub res_stream {
my $self = shift;
my (
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json decode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::
> 'Missing route') unless $route;
my $idx = $route->{idx} //= 0;
my $json = $route->{json};
my $project_name = $route->{project};
my $source = $route->{source};
il'}],
'+as' => ['job_try_id', 'job_try_ord', 'fail'],
},
);
unless($json) {
$res->content_type('text/plain');
my $body = join "\n" => map { $_->file } $fi
hare_dir/;
use App::Yath::Server::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use parent 'App::Yath::Server::Controller';
use Test2::Harness::Util::HashBase
pe ipc_warn pid_is_running/;
use Test2::Util::UUID qw/gen_uuid/;
use Test2::Harness::Util::JSON qw/encode_json/;
use Test2::Harness::Instance::Message;
use Test2::Harness::Instance::Request;
use Test
>read_file});
my $json = encode_json($msg);
my $ok;
while (1) {
$! = 0;
last if eval { local $SIG{PIPE} = 'IGNORE'; $self->pipe->write_message($json); 1 };
next i
f $! == EINTR;
$self->terminate();
croak "Disconnected pipe";
}
return $json;
}
sub send_request {
my $self = shift;
my ($api_call, $args, %params) = @_;
croak "