rror);
use Test2::Harness::UI::Util qw/ config_from_settings /;
use Test2::Harness::Util::JSON qw/decode_json/;
use Test2::Harness::Renderer::UIDB;
use parent 'App::Yath::Command';
use Test2::Harne
the YathUIDB plugin to upload a log file" }
sub group { 'log' }
sub cli_args { "[--] event_log.jsonl[.gz|.bz2]" }
sub description {
return <<" EOT";
EOT
}
sub run {
my $self = shif
id log file" unless -f $file;
die "'$file' does not look like a log file" unless $file =~ m/\.jsonl(\.(gz|bz2))?$/;
die "The YathUIDB plugin is required" unless $settings->check_prefix('yathu
r::State;
use Test2::Harness::UI::Util qw/config_from_settings/;
use Test2::Harness::Util::JSON qw/encode_json/;
use Test2::Harness::UI::UUID qw/gen_uuid uuid_inflate/;
use Test2::Harness::Util qw/m
rd++,
module => ref($res) || $res,
data => encode_json($data),
};
push @items => $item;
}
$res_rs->populate(\@items);
ret
= '0.000144';
use Test2::Harness::UI::Util qw/format_duration/;
use Test2::Harness::Util::JSON qw/encode_json/;
use Test2::Harness::UI::UUID qw/uuid_inflate/;
use Time::HiRes qw/time/;
use Parallel::
($page <= $pages) {
my $file = "./dump/${source}-" . sprintf("%0${len}d", $page) . ".jsonl.bz2";
die "Dump file '$file' already exists!\n" if -e $file;
$runner->r
my $fh = IO::Compress::Bzip2->new("./dump/${source}-" . sprintf("%0${len}d", $page) . ".jsonl.bz2") or die "Could not open log file: $IO::Compress::Bzip2::Bzip2Error";
my $s
eper;
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json/;
use parent 'Test2::Harness::UI::Controller';
use Test2::Harness::UI::Util::Ha
tent_type($ct);
if ($ct eq 'application/json') {
$res->raw_body($purged);
}
else {
$res->raw_body("<pre>" . encode_pretty_json($purged) . "</pre>");
}
return $res
esp error/;
use Test2::Harness::UI::Util qw/share_dir find_job/;
use Test2::Harness::Util::JSON qw/encode_json/;
use parent 'Test2::Harness::UI::Controller';
use Test2::Harness::UI::Util::HashBase qw
out;
$res->stream(
env => $req->env,
content_type => 'application/x-jsonl; charset=utf-8',
done => sub {
return 0 if @out;
return 0 if @s
rs->search({run_id => $lookup})->first };
return () unless $run;
return (
encode_json({type => 'run', data => $run }) . "\n",
);
}
sub lookup_jobs {
my $self = shift;
my
are_dir/;
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Harness::UI::UUID qw/uuid_inflate/;
use parent 'Test2::Harness::UI::C
1});
}
elsif ($act eq 'parameters') {
$res->content_type('application/json');
$res->raw_body($run->parameters);
return $res;
}
elsif
n->sweeps->delete;
$run->delete;
}
}
$res->content_type('application/json');
$res->raw_body($run);
return $res;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
GUID;
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json/;
use parent 'Test2::Harness::UI::Controller';
use Test2::Harness::UI::Util::Ha
ntent_type($ct);
if ($ct eq 'application/json') {
$res->raw_body($data);
}
else {
$res->raw_body("<pre>" . encode_pretty_json($data) . "</pre>");
}
return $res;
}
000144';
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use parent 'Test2::Harness::UI::Controller';
use Test2::Harness::UI::Util::HashB
ntent_type => 'application/x-jsonl',
done => sub { !@$data },
fetch => sub {
my $item = shift @$data or return;
return encode_json($item) . "\n";
},
inflate/;
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json/;
use JSON::PP();
use Carp qw/croak/;
use parent 'Test2::Harness::UI::Controller';
use Test2::
}
$res->stream(
env => $req->env,
content_type => 'application/x-jsonl; charset=utf-8',
cache => $cache,
done => sub {
my @keep;
: 0 },
sub {
my $update = JSON::PP::false;
if ($sig) {
$it->discard_changes;
$update = JSON::PP::true;
}
my $ne
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json decode_json/;
use Test2::Harness::UI::UUID qw/uuid_inflate/;
use parent 'Test2::Harne
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
ind_job/;
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use parent 'Test2::Harness::UI::Controller';
use Test2::Harness::UI::Util::HashB
|| $job->name) . ' - ' . $job->job_id . '+' . $job->job_try;
$res->content_type('application/json');
$res->raw_body($job);
return $res;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json decode_json/;
use Test2::Harness::UI::UUID qw/uuid_inflate/;
use parent 'Test2::Harne
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;
qw/max/;
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Harness::UI::UUID qw/uuid_inflate/;
use parent 'Test2::Harness::UI::C
event_ord'};
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',
);
ob/;
use Test2::Harness::UI::Util::DateTimeFormat qw/DTF/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Util::Times qw/render_duration/;
use Test2::Harness::UI::UUID qw/uuid_
};
$res->stream(
env => $req->env,
content_type => 'application/x-jsonl; charset=utf-8',
done => $advance,
fetch => sub {
return ()
ift @out or return ();
$complete = 1 if $item->{complete};
return encode_json($item) . "\n";
},
);
return $res;
}
sub data {
my $self = shift;
my ($r
st_name/;
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Harness::UI::UUID qw/uuid_deflate uuid_inflate/;
use parent 'Test2::H
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
are_dir/;
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Harness::UI::UUID qw/uuid_inflate/;
use parent 'Test2::Harness::UI::C
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json decode_json/;
use Test2::Harness::UI::UUID qw/uuid_inflate/;
use parent 'Test2::Harne
> 'Missing route') unless $route;
my $idx = $route->{idx} //= 0;
my $json = $route->{json};
my $project_name = $route->{project};
my $source = $route->{source};
$search,
{join => 'test_file', order_by => 'test_file.filename'},
);
unless($json) {
$res->content_type('text/plain');
my $body = join "\n" => map { $_->file } $fi
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
"Tree::AdjacencyList",
"UUIDColumns",
);
__PACKAGE__->table("sweeps");
__PACKAGE__->add_col
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
"Tree::AdjacencyList",
"UUIDColumns",
);
__PACKAGE__->table("permissions");
__PACKAGE__->ad
::Schema::Result::JobField;
use utf8;
use strict;
use warnings;
use Test2::Harness::Util::JSON qw/decode_json/;
use Carp qw/confess/;
confess "You must first load a Test2::Harness::UI::Schema::NAME
:InflateColumn::Serializer::JSON->get_unfreezer('data', {}),
deflate => DBIx::Class::InflateColumn::Serializer::JSON->get_freezer('data', {}),
},
);
sub TO_JSON {
my $self = shift;
my %cols = $self->get_all_fields;
$cols{data} = decode_json($cols{data}) if $cols{data} && !ref($cols{data});
return \%cols;
}
1;