App::Yath::Util qw/find_pfile/;
use File::Path qw/remove_tree/;
use Test2::Harness::Util::File::JSON();
use parent 'App::Yath::Command::abort';
use Test2::Harness::Util::HashBase;
sub group { 'per
ject-yath-persist.json. If no project is specified then it will fall back to the current directory. If the current directory is not writable it will default to /tmp/yath-persist.json which limits you
o/log.jsonl
=item --cover-from http://example.com/coverage
=item --cover-from path/to/coverage.jsonl
=item --no-cover-from
This can be a test log, a coverage dump (old style json or new jsonl form
p::Yath::Util qw/find_pfile/;
use Test2::Harness::Runner::State;
use Test2::Harness::Util::File::JSON();
use Test2::Harness::Util::Queue();
use parent 'App::Yath::Command::status';
use Test2::Harnes
ject-yath-persist.json. If no project is specified then it will fall back to the current directory. If the current directory is not writable it will default to /tmp/yath-persist.json which limits you
o/log.jsonl
=item --cover-from http://example.com/coverage
=item --cover-from path/to/coverage.jsonl
=item --no-cover-from
This can be a test log, a coverage dump (old style json or new jsonl form
ject-yath-persist.json. If no project is specified then it will fall back to the current directory. If the current directory is not writable it will default to /tmp/yath-persist.json which limits you
o/log.jsonl
=item --cover-from http://example.com/coverage
=item --cover-from path/to/coverage.jsonl
=item --no-cover-from
This can be a test log, a coverage dump (old style json or new jsonl form
json
=item --cover-from-type jsonl
=item --cover-from-type log
=item --no-cover-from-type
File type for coverage source. Usually it can be detected, but when it cannot be you should specify. "json
ebug;
use strict;
use warnings;
our $VERSION = '1.000161';
use Test2::Harness::Util::JSON qw/encode_pretty_json/;
use Test2::Util::Table qw/table/;
use Test2::Harness::Util qw/find_libraries mod2fil
ut a summary json file, if no path is provided 'summary.json' will be used. The .json extension is added automatically if omitted.",
long_examples => ['', '=/path/to/summary.json'],
lize_summary {
my $val = shift;
return $val if $val eq '1';
$val =~ s/\.json$//g;
$val .= '.json';
return clean_path($val);
}
sub summary_action {
my ($prefix, $field, $raw
our $VERSION = '1.000161';
use App::Yath::Util qw/find_pfile/;
use Test2::Harness::Util::File::JSON;
use parent 'App::Yath::Command';
use Test2::Harness::Util::HashBase;
sub group { 'persist' }
return 0;
}
print "\nFound: $pfile\n";
my $data = Test2::Harness::Util::File::JSON->new(name => $pfile)->read();
print " PID: $data->{pid}\n";
print " Dir: $data->{dir}\n
ject-yath-persist.json. If no project is specified then it will fall back to the current directory. If the current directory is not writable it will default to /tmp/yath-persist.json which limits you
ject-yath-persist.json. If no project is specified then it will fall back to the current directory. If the current directory is not writable it will default to /tmp/yath-persist.json which limits you
ject-yath-persist.json. If no project is specified then it will fall back to the current directory. If the current directory is not writable it will default to /tmp/yath-persist.json which limits you
hort => 'f',
long_examples => [' name:details', ' JSON_STRING'],
short_examples => [' name:details', ' JSON_STRING'],
description => "Add custom data to the harnes
m/^{/) {
my $field = {};
my $ok = eval { $field = Test2::Harness::Util::JSON::decode_json($norm); 1 };
chomp(my $error = $@ // '');
die "Error parsing field specif
ID inside tests (default: on)
=item --fields name:details
=item --fields JSON_STRING
=item -f name:details
=item -f JSON_STRING
=item --no-fields
Add custom data to the harness run
Can be spec
E DATA
The data is attached to the 'run' entry in the log file. This can be seen
directly in the json data. The data is also easily accessible with
L<Test2::Harness::UI>.
The data will include the l
,
details => $short,
raw => $raw,
data => \%data,
};
}
sub TO_JSON { ref($_[0]) }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
App::Yath::Plugin::SysInfo - Plu
::Notify;
use strict;
use warnings;
our $VERSION = '1.000161';
use Test2::Harness::Util::JSON qw/encode_json/;
use Test2::Harness::Util qw/mod2file/;
use Sys::Hostname qw/hostname/;
use Carp qw/cr
rl,
{
headers => {'content-type' => 'application/json'},
content => encode_json({channel => $dest, text => $text}),
},
);
warn "
00161';
use Test2::Harness::Util qw/clean_path mod2file/;
use Test2::Harness::Util::JSON qw/encode_json stream_json_l/;
use Test2::Harness::Util::UUID qw/gen_uuid/;
use parent 'App::Yath::Plugin';
u
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 --
x, $field, $raw, $norm, $slot, $settings) = @_;
return $$slot = clean_path("coverage.jsonl") if $raw eq '1';
return $$slot = $norm;
},
);
option aggregator =>
ab a run UUID and derive tests to re-run from that.",
long_examples => ['', '=path/to/log.jsonl', '=plugin_specific_string'],
);
option rerun_plugin => (
type => 'm',
description => $RERUN_MODES{$mode},
long_examples => ['', '=path/to/log.jsonl', '=plugin_specific_string'],
ignore_for_build => 1,
);
}
option ch
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
type => 'b',
description => "When using staged preload, dump the depmap for each stage as json files",
default => 0,
);
option includes => (
name => 'include',
dump-depmap
=item --no-dump-depmap
When using staged preload, dump the depmap for each stage as json files
=item --event-timeout SECONDS
=item --et SECONDS
=item --no-event-timeout
Kill test if
: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};
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
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("hosts");
__PACKAGE__->add_columns(
"host_id",
{ data_type => "bigint
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',
);
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
eeper;
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
tent_type($ct);
if ($ct eq 'application/json') {
$res->raw_body($purged);
}
else {
$res->raw_body("<pre>" . encode_pretty_json($purged) . "</pre>");
}
return $res