p qw/confess/;
use List::Util qw/min/;
use Time::HiRes qw/time/;
use Test2::Harness::Util::JSON qw/encode_json/;
use Importer 'Test2::Util::Facets2Legacy' => ':ALL';
BEGIN {
require Test2::Event
<facet_data
<stream_id
<event_id
<run_id
<job_id
<job_try
<stamp
+json
processed
};
sub trace { $_[0]->{+FACET_DATA}->{trace} }
sub set_trace { confess "'trace
= $v1 // $v2 // $v3;
}
delete $data->{facet_data};
}
sub as_json { $_[0]->{+JSON} //= encode_json($_[0]) }
sub TO_JSON {
my $out = {%{$_[0]}};
$out->{+FACET_DATA} = { %{$out->{+FA
uid/;
our $VERSION = '2.000004';
my @NO_JSON;
BEGIN {
@NO_JSON = qw{
ipc
connect
send_event_cb
};
sub no_json { @NO_JSON }
}
use Test2::Harness::Util::HashBase(
<jobs
<job_lookup
<test_settings
<settings
},
(map { "+$_" } @NO_JSON),
);
sub init {
my $self = shift;
croak "'run_id' is a required attribute" unless $self
e $data{$_} for $self->no_json, qw/jobs job_lookup/;
return \%data;
}
sub TO_JSON {
my $self = shift;
my %data = %$self;
delete $data{$_} for $self->no_json;
return \%data;
}
:IPC::Util qw/ipc_warn/;
use Test2::Util::UUID qw/gen_uuid/;
use Test2::Harness::Util::JSON qw/encode_pretty_json/;
use Test2::Harness::Util::HashBase qw{
+stop
runner
single_run
<re
t) {
warn "Job '$job_id' took too long to start, timing it out: " . encode_pretty_json($job_data->{job});
my $info = delete $job_data->{run}->running->{$job_id};
JSON qw/decode_json encode_json/;
use List::Util qw/first/;
use Cwd qw/getcwd/;
use Carp qw/croak/;
use Time::HiRes qw/time/;
use Text::ParseWords qw/quotewords/;
use Test2::Harness::Util::File::JSON
my @args = (
name => 'durations',
is_json => 1,
http_args => [{headers => {'Content-Type' => 'application/json'}}],
);
if ($primary) {
local $@;
my $is_json = $params{is_json};
if (my $type = ref($in)) {
return $in if $is_json && ($type eq 'HASH' || $type eq 'ARRAY');
}
elsif (-f $in) {
if ($is_json) {
/parse_exit mod2file/;
use Test2::Util::UUID qw/gen_uuid/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Plack::Runner;
use DBIx::QuickDB;
use App::Yath::Server::Plack;
use App::Ya
ncode_json({
schema_config => $self->{+SCHEMA_CONFIG},
launcher_options => \@options,
}),
);
}
sub _do_server_post_exec {
my $class = shift;
my ($json) = @
_;
$0 = "yath-web-server";
my $data = decode_json($json);
my $r = Plack::Runner->new;
$r->parse_options(@{$data->{launcher_options}});
my $app = App::Yath::Server::Plack->new(
Util qw/find_libraries clean_path mod2file read_file/;
use Test2::Harness::Util::JSON qw/encode_pretty_json decode_json/;
my $APP_PATH = __FILE__;
$APP_PATH =~ s{App\S+Yath\.pm$}{}g;
$APP_PATH = clea
"\nargs: " . join(', ' => @args) . "\n" if @args;
my $json = $group eq '1' ? encode_pretty_json($settings) : encode_pretty_json($settings->{$group} // "!! Invalid Group '$group' !!");
out .= "\nCurrent command line and config options result in these settings:\n";
$out .= "$json\n";
$out .= $self->_render_groups(
title => 'If the above output is too much
gzip, or
compressed in bzip2.
=head1 FORMAT
The log file is in jsonl format. Each line of the log can be indepentantly
parsed as json. Each line represents a single event Test2::Harness processed
du
different
processes. A complete log will be terminated by the string C<null>, which is
also valid json. If a log is missing this terminator it is considered an
incomplete log.
=head2 EVENTS
B<Please
_formatters} }) {
if ($f =~ /\A\[/) {
require JSON::PP;
$f = JSON::PP::decode_json($f);
} else {
if ($f =~ /(.+)=(.*)/) {
&& $r0 =~ /\A\{/) {
require JSON::PP;
$r = JSON::PP::decode_json($r0);
} else {
A\[/) {
require JSON::PP;
$f = JSON::PP::decode_json($f);
} else {
l qw/start_collected_process ipc_connect set_procname/;
use Test2::Harness::Util::JSON qw/decode_json_file encode_json_file/;
use Test2::Util::UUID qw/gen_uuid/;
use Test2::Harness::Util::HashBase qw
_subprocess_run(\$ARGV[0]))", # Run it.
encode_json_file({parent_pid => $$, $self->subprocess_args}), # json data
);
}
sub spawn_process {
my $self = shift;
my %pa
rocess_run {
my $class = shift;
my ($json_file) = @_;
STDOUT->autoflush(1);
STDERR->autoflush(1);
my $params = decode_json_file($json_file);
set_procname(set => ['resource',
k ||= 1;
return $rank;
}
sub TO_JSON {
my $self = shift;
return { %$self };
}
sub process_info {
my $self = shift;
my $out = $self->TO_JSON;
delete $out->{+TEST_SETTINGS};
s::Util qw/mod2file parse_exit open_file chmod_tmp/;
use Test2::Harness::Util::JSON qw/decode_json encode_json decode_json_file/;
use Test2::Harness::IPC::Util qw/pid_is_running swap_io start_process
encode_json($_) . "\n" for @_ };
}
elsif ($self->{+OUTPUT}->isa('Atomic::Pipe')) {
my $wp = $self->{+OUTPUT};
$self->{+OUTPUT_CB} = sub { $wp->write_message(encode_json($_)) f
= @_;
if ($in =~ m/\.json$/ || -f $in) {
%params = %{decode_json_file($in, unlink => 1)};
}
else {
%params = %{decode_json($in)};
}
}
e
est2::Harness::Util qw/clean_path file2mod open_file/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json/;
our $VERSION = '2.000004';
BEGIN {
local $@;
my $inotify = eval { re
return (0, reason => $err) unless $ok;
return (0, reason => "Got warnings: " . encode_pretty_json(\@warnings)) if @warnings;
return (1);
}
sub find_churn {
my $self = shift;
my ($fil
016-01-01T12:34:00
#pod
#pod ### Response:
#pod 200 OK
#pod Content-Type: application/json
#pod
#pod [
#pod {
#pod "dist": "My-Dist",
#pod "version": "1
r/PREACTION?since=2016-01-01T12:34:00
### Response:
200 OK
Content-Type: application/json
[
{
"dist": "My-Dist",
"version": "1.000",
"auth
ith raw test reports
#pod =head1 DESCRIPTION
#pod
#pod This API allows working directly with the JSON report documents
#pod submitted by the army of testers of CPAN.
#pod
#pod =head1 SEE ALSO
#pod
#p
rts
=head1 VERSION
version 0.029
=head1 DESCRIPTION
This API allows working directly with the JSON report documents
submitted by the army of testers of CPAN.
=head1 METHODS
=head2 report_post
y::Adapter;
use Alien::SwaggerUI;
use File::Spec::Functions qw( catdir catfile );
use JSON::MaybeXS qw( encode_json );
#pod =method schema
#pod
#pod my $schema = $c->schema;
#pod
#pod Get the sch
ast_json = sub( $c, $data ) {
if ( blessed $data || ( ref $data eq 'HASH' && $data->{errors} ) ) {
return Mojo::JSON::encode_json( $data );
}
return encode_json( $d
API' => 'v1.json' ),
allow_invalid_ref => 1,
renderer => $render_fast_json,
} );
$app->plugin( OpenAPI => {
url => dist_file( 'CPAN-Testers-API' => 'v3.json' ),
mary/My-Dist/1.000
#pod
#pod ### Response:
#pod 200 OK
#pod Content-Type: application/json
#pod
#pod [
#pod {
#pod "guid": "00000000-0000-0000-0000-0000000000001",
ist
GET /v3/summary/My-Dist/1.000
### Response:
200 OK
Content-Type: application/json
[
{
"guid": "00000000-0000-0000-0000-0000000000001",
"id": 1
y);
use JSON::MaybeXS;
use Data::Dumper;
use Time::Piece;
use Plack::Util;
use Module::Metadata;
use Syntax::Keyword::Dynamically;
use Syntax::Keyword::Try;
our @EXPORT = qw(dmsg json __pkgfn
} @ENV{qw'FRAME_DEBUG DEBUG'};
#sub _json_default {
# JSON::MaybeXS->new( utf8 => 1, $dev_mode ? ( pretty => 1 ) : () );
#}
const our $json_default => JSON::MaybeXS->new( utf8 => 1, $DEV_MODE ?
RT_DOES;
$^H{ __PACKAGE__ . '/user' } = 1;
field $app : weak : param : accessor = undef;
field $json;
field $debug_mode :param :accessor = $DEBUG_MODE;
field $dev_mode :param :accessor = $DEV_MODE;
pod # ?limit=2
#pod
#pod ### Response:
#pod 200 OK
#pod Content-Type: application/json
#pod
#pod [
#pod {
#pod "dist": "My-Dist",
#pod "version": "1
# ?maturity=stable
# ?limit=2
### Response:
200 OK
Content-Type: application/json
[
{
"dist": "My-Dist",
"version": "1.000",
"pass
ontroller : does(Frame::Base);
use utf8;
use v5.40;
use Carp;
use Encode;
use Text::Xslate;
use JSON::MaybeXS;
use Feature::Compat::Try;
use Frame::Request;
use Const::Fast;
const our @EXPORT_DOES
$content_type ||= "application/json; charset=$opts{charset}";
try {
$res->content_type($content_type);
$res->body( json->encode($content) )
}
s => $status, msg => $content }
if ( $content_type // $req->maybe_ajax ) =~ Frame::Request::JSONRE;
$self->render( $content, $status, $content_type, @args );
}
method render_500 ( $content
er::Metrics;
use Pheno::Ranker::Graph;
use Exporter 'import';
our @EXPORT_OK = qw($VERSION write_json);
# Personalize warn and die functions
$SIG{__WARN__} = sub { warn BOLD YELLOW "Warn: ", @_ };
$
as hpo_file => (
default => catfile( $share_dir, 'db', 'hp.json' ),
coerce => sub { $_[0] // catfile( $share_dir, 'db', 'hp.json' ) },
is => 'ro',
isa => sub { die "Error <$_
ed_phenotypicFeatures align align_basename export export_basename
log verbose age cytoscape_json graph_stats/
] => ( is => 'ro' );
has [qw/append_prefixes reference_files patients_of_interest/]