rack
scheduled_track
realtime_track
)
);
sub new {
my ( $obj, %opt ) = @_;
my $json = $opt{json};
my $realtime = $opt{realtime} // 0;
my $cancelled = $opt{cancelled};
my $time_zone
::Status::MOTIS::Stop->from_stopover( json => $json ),
is_realtime => $realtime,
is_cancelled => $json->{cancelled} // $cancelled,
};
if ( $json->{scheduledArrival} ) {
$ref->{scheduled_arr
= DateTime::Format::ISO8601->parse_datetime(
$json->{scheduledArrival} );
$ref->{scheduled_arrival}->set_time_zone( $time_zone );
}
if ( $json->{arrival} and $realtime ) {
$ref->{realtime_a
name},
meta => $args{meta},
common_opts => $common_opts,
per_arg_json => 1,
);
print $res->[2];
}
sub _run_cmd {
require Perinci::Result::Format::Lite;
argv},
meta => $args{meta},
check_required_args => 0,
per_arg_json => 1,
common_opts => $common_opts,
);
if ($res->[0] == 501) {
;
use Test2::Harness::Util qw/clean_path mod2file fqmod/;
use Test2::Harness::Util::JSON qw/encode_json stream_json_l/;
use Test2::Util::UUID qw/gen_uuid/;
use parent 'App::Yath::Plugin';
use Test2:
alize => \&clean_path,
long_examples => ['', '=coverage.jsonl', '=coverage.json'],
description => "Create a json or jsonl file of all coverage data seen during the run (This implies --
cover-files).",
autofill => sub { clean_path("coverage.jsonl") },
);
option aggregator => (
type => 'Scalar',
alt => ['agg'],
long_examples => [' ByTest', ' B
E DATA
The data is attached to the 'run' entry in the log file. This can be seen
directly in the json data, database, or server.
The data will include the long sha, short sha, branch name, and a bri
unless @fields;
$run->send_event(facet_data => {harness_run_fields => \@fields});
}
sub TO_JSON { ref($_[0]) }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
App::Yath::Plugin::SysInfo - Plu
000004';
use Carp();
use Getopt::Yath::Settings::Group;
use Test2::Harness::Util::JSON qw/decode_json decode_json_file/;
sub new {
my $class = shift;
my $self = @_ == 1 ? $_[0] : { @_ };
OM_JSON_FILE {
my $class = shift;
my ($file, %params) = @_;
my $data = decode_json_file($file, %params);
$class->new($data);
}
sub FROM_JSON {
my $class = shift;
my ($json) =
@_;
my $data = decode_json($json);
$class->new($data);
}
sub TO_JSON {
my $self = shift;
return {%$self};
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Getopt::Yath::Settings
004';
use Carp qw/croak/;
use Time::HiRes qw/sleep time/;
use Test2::Harness::Util::JSON qw/encode_json encode_json/;
use parent 'Plack::Response';
use Importer Importer => 'import';
our %EXPORT_AN
}) {
$data = $go->$meth();
}
my $out = encode_json($data) . "\n";
return $out;
};
}
else {
$
$self->{errors} ||= []} => @_;
return;
}
sub as_json {
my $self = shift;
my (%inject) = @_;
$self->content_type('application/json');
my $data = {
%inject,
messag
ne option. An example (the lines below are writen in configuration
file in IOD syntax, as rows of JSON hashes):
; remove all comments in field values when 'hide_field_name' option is set
; (w
E, {ARG1NAME => ARG1VAL, ...}]
If formatter name begins with `[` character, it will be parsed as JSON. Example:
['Str::remove_comment', {'style':'cpp'}]
Note that this option overrides `--field-va
alize { }
sub instance_setup { }
sub instance_teardown { }
sub instance_finalize { }
sub TO_JSON { ref($_[0]) || "$_[0]" }
sub redirect_io { Carp::confess("redirect_io() is deprecated") }
sub s
enames, and will be used as
the output tag (best to limit it to 8 characters).
=item $plugin->TO_JSON
This is here as a bare minimum serialization method. It returns the plugin
class name.
=back
=
ponse qw/resp error/;
use App::Yath::Util qw/share_dir/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Harness::Util::HashBase qw{
<schema_config
<single_run
<s
, failed => 1});
$router->connect('/failed/:source/json' => {controller => 'App::Yath::Server::Controller::Files', failed => 1, json => 1});
$router->connect('/failed/:project/:id'
roller::Files', failed => 1, json => 1});
$router->connect('/failed/:project/:username/:id' => {controller => 'App::Yath::Server::Controller::Files', failed => 1, json => 1});
$router->connec
e DBI;
use DateTime;
use Scope::Guard;
use Carp qw/croak/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Util::UUID qw/gen_uuid/;
our $VERSION = '2.000004';
use Test2::Harne
$subcount++;
my ($key) = keys(%$item);
my $line = encode_json($item);
print $wh $line, "\n";
}
}
$counter++;
;
my $last_run_uuid;
my $broken;
while (my $line = <$rh>) {
my $data = decode_json($line);
my ($type, @bad) = keys %$data;
die "Invalid data!" if @bad;
$s
ream = *set_use_stream;
*test_args = *args;
*set_test_args = *set_args;
}
sub TO_JSON { +{%{$_[0]}, class => blessed($_[0])} }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Test2:
ons::Run;
use strict;
use warnings;
our $VERSION = '2.000004';
use Test2::Harness::Util::JSON qw/decode_json/;
use Test2::Util::UUID qw/gen_uuid/;
use Test2::Harness::Util qw/fqmod/;
use List::Util
"Add custom data to the harness run",
normalize => sub { m/^\s*\{.*\}\s*$/s ? decode_json($_[0]) : {mesh(['name', 'details'], [split /[=]/, $_[0]])} },
);
option run_id => (
lt => 0,
description => "When using staged preload, dump the depmap for each stage as json files",
);
option reload_in_place => (
type => 'Bool',
alt
=> ['', '=path/to/log.jsonl', '=plugin_specific_string'],
autofill => sub {
my $log = first { -e $_ } qw{ ./lastlog.jsonl ./lastlog.jsonl.bz2 ./lastlog.jsonl.gz };
re
ples => [' file.json', ' http://example.com/durations.json'],
short_examples => [' file.json', ' http://example.com/durations.json'],
description => "Point at a json file or url whic
ples => [' file.json', ' http://example.com/durations.json'],
short_examples => [' file.json', ' http://example.com/durations.json'],
description => "Point at a json file or url whic
qw{
-_schema
<dbi_dsn <dbi_user <dbi_pass
<ephemeral
<ephemeral_stack
};
sub TO_JSON {
my $self = shift;
my %data = %$self;
delete $data{+_SCHEMA};
delete $data{+EPH
s format_uuid_for_db/;
use Test2::Util::UUID qw/gen_uuid/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use App::Yath::Schema::ImportModes qw{
%MODES
record_all_events
even
nect} = 1 if $App::Yath::Schema::LOADED =~ m/(mysql|percona|maraidb)/i;
}
my $e = decode_json(scalar $line);
my $f = $e->{facet_data};
my $self;
my ($run_id, $run_uuid);
if (
{
my ($line, $idx) = @_;
return if eval {
my $e = decode_json($line);
$self->process_event($e, undef, $idx);
1;
};
ase qw/-config -worker_id/;
use Test2::Util::UUID qw/gen_uuid/;
use Test2::Harness::Util::JSON qw/decode_json/;
use IO::Uncompress::Bunzip2 qw($Bunzip2Error);
use IO::Uncompress::Gunzip qw($GunzipE
next if $line =~ m/^null$/ims;
my $ln = $.;
my $error = $self->process_event_json($processor, $ln => $line) or next;
push @errors => "error processing line number $ln: $er
return $status;
}
sub process_event_json {
my $self = shift;
my ($processor, $ln, $json) = @_;
my $ok = eval {
my $event = decode_json($json);
$processor->process_event(
parent 'DBIx::Class::Core';
*get_all_fields = __PACKAGE__->can('get_inflated_columns');
sub TO_JSON {
my $self = shift;
my %cols = $self->get_all_fields;
return \%cols;
}
1;
__END__
2file/;
use Test2::Harness::IPC::Util qw/ipc_warn ipc_loop/;
use Test2::Harness::Util::JSON qw/encode_pretty_json/;
use Test2::Harness::Instance::Message;
use Test2::Harness::Instance::Request;
use T