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
'0.000144';
use Carp qw/croak/;
use Time::HiRes qw/sleep time/;
use Test2::Harness::Util::JSON qw/encode_json/;
use parent 'Plack::Response';
use Importer Importer => 'import';
our %EXPORT_ANON = (
my ($done, $fetch);
if(my $rs = $params{resultset}) {
my $json = Test2::Harness::Util::JSON::JSON()->new->utf8(0)->convert_blessed(1)->allow_nonref(1);
my $go = 1;
method}) {
$data = $go->$meth();
}
my $out = $json->encode($data) . "\n";
return $out;
};
}
else {
I::UUID qw/gen_uuid uuid_inflate uuid_mass_deflate/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use JSON::PP();
use Test2::Harness::UI::Util::ImportModes qw{
%MODES
record_al
{
$f->{parent}->{children} = "Removed";
}
$e->{orphan} = encode_json($f);
$e->{orphan_line} = $params{line} if $params{line};
}
else {
if (my
r($job, $f) if $e->{is_harness};
}
clean($f);
$e->{facets} = encode_json($f);
$e->{facets_line} = $params{line} if $params{line};
}
return $e;
}
sub add
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
}
else { confess "Deadly warning: @_" }
};
# Useful common code
use HTTP::Tiny;
use JSON::MaybeXS;
use Pg::SQL::PrettyPrinter::Node;
our $VERSION = '0.11';
sub new {
my ( $class, %
croak( "Couldn't parse the queries! : " . Dumper( $res ) );
}
my $struct = decode_json( $res->{ 'content' } );
croak( "Parse error: " . $struct->{ 'error' } ) if exists $struct->{
r::Node>.
=head2 string
Helper method to return string value regardless of how it's provided in JSON.
This is required because of changes in underlying ruby library.
=head2 as_text
Returns this o
s being sent from the parser as JSON.
=head2 validate_struct
Checks if given structure (either from constructor's C<struct> field, or
obtained after deserializing JSON obtained from parsing microser
000144';
use Test2::Harness::UI::Util qw/config_from_settings/;
use Test2::Harness::Util::JSON qw/decode_json/;
use Test2::Harness::Util qw/mod2file looks_like_uuid/;
use App::Yath::Options;
use par
rab_rerun {
my $this = shift;
my ($rerun, %params) = @_;
return (0) if $rerun =~ m/\.jsonl(\.gz|\.bz2)?/;
my $settings = $params{settings};
my $mode_hash = $params{mode_hash} //
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
"Tree::AdjacencyList",
"UUIDColumns",
);
__PACKAGE__->table("sweeps");
__PACKAGE__->add_col
re_dir/;
use Test2::Harness::UI::Response qw/resp error/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Harness::UI::Util::HashBase qw/-config -router/;
sub init {
my $
failed => 1});
$router->connect('/failed/:source/json' => {controller => 'Test2::Harness::UI::Controller::Files', failed => 1, json => 1});
$router->connect('/failed/:project/:idx'
oller::Files', failed => 1, json => 1});
$router->connect('/failed/:project/:username/:idx' => {controller => 'Test2::Harness::UI::Controller::Files', failed => 1, json => 1});
$router->conne
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
warnings;
use DBI;
use Scope::Guard;
use Carp qw/croak/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Harness::UI::UUID qw/uuid_inflate gen_uuid/;
our $VERSION = '0.000144
;
return $self->_get_jsonl_runs($dbh_or_file)
if $dbh_or_file =~ m/\.jsonl$/ && -f $dbh_or_file;
return $self->_get_dbh_runs($dbh_or_file);
}
sub _get_jsonl_runs {
my $self = sh
$subcount++;
my ($key) = keys(%$item);
my $line = encode_json($item);
print $wh $line, "\n";
}
}
$counter++;
= '0.000144';
use Test2::Harness::UI::Util qw/format_duration/;
use Test2::Harness::Util::JSON qw/decode_json/;
use Test2::Harness::UI::UUID qw/uuid_deflate/;
use Time::HiRes qw/time/;
use Parallel::
dump dir: $!";
for my $file (sort readdir($dh)) {
next unless $file =~ m/^(.+)-(\d+)\.jsonl\.bz2$/;
my ($type, $seq) = ($1, $2);
die "'$type' is not a valid type.\n" unless
chomp($line);
$count++;
my $row = decode_json($line);
for my $col (keys %$cols_info) {
my
*inflate = \&uuid_inflate;
sub binary { $_[0]->{binary} }
sub string { $_[0]->{string} }
sub TO_JSON { $_[0]->{string} }
sub uuid_mass_inflate { _uuid_mass_flate($_[0], \&uuid_inflate, \&uuid_mass_
= '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
m::Table;
use Test2::Harness::UI::Util qw/config_from_settings/;
use Test2::Harness::Util::JSON qw/decode_json/;
use parent 'App::Yath::Command';
use Test2::Harness::Util::HashBase;
use App::Yath::O
->{status}: $res->{reason}\n$res->{content}\n"
unless $res->{success};
return decode_json($res->{content});
}
sub get_from_db {
my $self = shift;
my ($settings, $config, $project
'-desc' => 'added'}, rows => $count},
list => 1,
);
my $data = [];
while (my $run = $runs->next) {
push @$data => $run->TO_JSON;
}
return $data;
}
1;
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
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;
}
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
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