Group
Extension

Matches 11

Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/configsmoke.pod ( view source; MetaCPAN )
ile>: The report that is generated at the end of the run (I<mktest.rpt>).

=item

B<jsnfile>: The json that will be send to the Perl5CoreSmokeDB (I<mktest.jsn>).

=item

B<lfile>: Absolute location of
Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/bin/tsarchivelog.pl ( view source; MetaCPAN )
e Test::Smoke::App::Options;
use Test::Smoke::App::SmokePerl;
use File::Copy;
use File::Spec;
use JSON;
use Path::Tiny ();
use POSIX ();


my $app = Test::Smoke::App::SmokePerl->new(
    Test::Smoke::
 File::Spec->catfile($app->option('ddir'), $app->option('jsnfile'));
die "Could not locate mktest.json" unless -f $jsnfile;
my $log_file = compose_log_file_name($adir, $jsnfile);

my $localtime = POSI
   my ($adir, $jsnfile) = @_;
    my $utf8_encoded_json_text = Path::Tiny::path($jsnfile)->slurp_utf8;
    my $config = decode_json($utf8_encoded_json_text);
    my $SHA = $config->{sysinfo}->{git_id}
Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/Test/Smoke/App/Options.pm ( view source; MetaCPAN )
        ],
        general_options => [
            adir(),
            commit_sha(),
            jsonreport(),
            max_reports(),
            smokedb_url(),
        ],
        special_options
re the JSON report in.',
    );
}

sub jsonreport {
    return $opt->new(
        name     => 'jsonreport',
        option   => '=s',
        default  => undef,
        helptext => "Name of json repor
port',
        option => '!',
        default => $default,
        helptext => "Create the report/json files.",
    );
}

sub rptfile {
    return $opt->new(
        name => 'rptfile',
        option 
Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/Test/Smoke/Util/LoadAJSON.pm ( view source; MetaCPAN )
package Test::Smoke::Util::LoadAJSON;
use warnings;
use strict;

our $VERSION = '0.04';

=head1 NAME

Test::Smoke::Util::LoadAJSON - A Cpanel::JSON::XS/JSON:PP/JSON::XS Factory Class

=head1 SYNOPSIS

    use Test::Smoke::Util::LoadAJSON;
    my $json = Test::Smoke::Util::LoadAJSON->new->utf8->pretty->encode(\%data);

=head1 DESCRIPTION

This is purely a fallback factory class that helps keep our 
h a clean perl 5.14+ install that have L<JSON::PP> but not
JSON. Also people that installed L<JSON::XS> on a pre-5.14 system.

Also checks for C<$ENV{PERL_JSON_BACKEND}> to force either of the two.

=
Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/Test/Smoke/App/SendReport.pm ( view source; MetaCPAN )
('smokedb_url') >>

=back

=cut

sub run {
    my $self = shift;

    $self->check_for_report_and_json;

    if ($self->option('mail')) {
        $self->{_mailer} = Test::Smoke::Mailer->new(
         
 }
}

=head2 $sendrpt->check_for_report_and_json()

Check for the '.rpt' and the '.jsn' file, return true if both exist.

=cut

sub check_for_report_and_json {
    my $self = shift;

    my $rptfile =
      $self->log_info("Regenerate report and json.");
        $self->regen_report_and_json();
    }
    return 1;
}

=head2 $sendrpt->regen_report_and_json()

Create a reporter object and generate the
Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/Test/Smoke/App/RepostFromArchive.pm ( view source; MetaCPAN )
  --sha <commit-sha>      Commit SHA for the smoke (repeat for more reports)

  --jsonreport <filename> The actual json-file to re-post

Override the config:

  --adir <dir>         Archive directory
 the json files from the archive.

=cut

sub pick_reports {
    my $self = shift;

    if (my $jsonreport = $self->option('jsonreport')) {
        die("Cannot find '$jsonreport'") unless -f $jsonrepor
t;
        if ($jsonreport =~ m{^ / }x) {
            $self->poster->ddir('');
        }
        else {
            $self->poster->ddir(curdir());
        }
        return ($jsonreport);
    }

    my
Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/Test/Smoke/Poster/HTTP_Tiny.pm ( view source; MetaCPAN )
=> $self->ua_timeout) : () ),
    );

    return $self;
}

=head2 $poster->_post_data()

Post the json to CoreSmokeDB using HTTP::Tiny.

=cut

sub _post_data {
    my $self = shift;

    $self->log_in
$self->poster);
    $self->log_debug("Report data: %s", my $json = $self->get_json);

    my $form_data = sprintf("json=%s", uri_escape($json));
    my $response = $self->ua->request(
        POST => 
onse->{content});

    return $response->{content};
}

=head2 $poster->_post_data_api()

Post the json to CoreSmokeDB using HTTP::Tiny, using the API-function.

=cut

sub _post_data_api {
    my $self
Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/Test/Smoke/Poster/LWP_UserAgent.pm ( view source; MetaCPAN )
string(),
        %extra_args
    );

    return $self;
}

=head2 $poster->_post_data()

Post the json to CoreSmokeDB using LWP::UserAgent.

=cut

sub _post_data {
    my $self = shift;

    $self->lo
    $self->log_debug("Report data: %s", my $json = $self->get_json);

    my $response = $self->ua->post(
        $self->smokedb_url,
        { json => $json }
    );
    if ( !$response->is_success )
elf->poster);
    $self->log_debug("Report data: %s", my $json = $self->get_json);

    my $post_data = sprintf(qq/{"report_data": %s}/, $json);

    require HTTP::Request;
    require HTTP::Headers;
Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/Test/Smoke/Poster/Base.pm ( view source; MetaCPAN )
t::Smoke;
require Test::Smoke::PostQueue;

use File::Spec::Functions;
use Test::Smoke::Util::LoadAJSON;

=head1 NAME

Test::Smoke::Poster::Base - Base class for the posters to CoreSmokeDB.

=head1 DES

Named.

=over

=item smokedb_url => $some_url

=item ddir => $smoke_directory

=item jsnfile => $json_file (mktest.jsn)

=item v => $verbosity

=back

=head3 Returns

An instance of the class.

=head
et_json()

=head3 Arguments

None.

=head3 Returns

The json string that was stored in C<< $ddir/$jsnfile >>.

=head3 Exceptions

File I/O.

=cut

sub get_json {
    my $self = shift;

    my $json_fi
Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/Test/Smoke/Poster/Curl.pm ( view source; MetaCPAN )
,
        verbose => $self->v
    );

    return $self;
}

=head2 $poster->_post_data()

Post the json to CoreSmokeDB using L<curl(1)>.

=cut

sub _post_data {
    my $self = shift;

    $self->log_in
$self->poster);
    $self->log_debug("Report data: %s", my $json = $self->get_json);

    my $form_data = sprintf("json=%s", uri_escape($json));
    my ($fh, $filename) = tempfile('curl-tsrepostXXXXXX
oreSmokeDB] %s", $response);

    return $response;
}

=head2 $poster->_post_data_api()

Post the json to CoreSmokeDB API-function using L<curl(1)>.

=cut

sub _post_data_api {
    my $self = shift;

Test-Smoke ( C/CO/CONTRA/Test-Smoke-1.84.tar.gz, CONTRA, 2025; MetaCPAN )
Test-Smoke/lib/Test/Smoke/Reporter.pm ( view source; MetaCPAN )
;
use Cwd;
use Encode qw( decode encode );
use File::Spec::Functions;
use Test::Smoke::Util::LoadAJSON;
use POSIX qw( strftime );
use System::Info;
use Test::Smoke::Util qw(
    grepccmsg grepnonfatal
end_log send_out user_note/, grep m/^_/ => keys %rpt;

    my $json = JSON->new->utf8(1)->pretty(1)->encode(\%rpt);

    # write the json to file:
    my $jsn_file = catfile($self->{ddir}, $self->{jsn
$json;
        close $jsn;
        $self->log_info("Write to '%s': ok", $jsn_file);
    }
    else {
        $self->log_warn("Error creating '%s': %s", $jsn_file, $!);
    }

    return $self->{_json}

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.