<commit_before>#!/usr/bin/perl -w
use strict;
# 2015 by <NAME>
# Licensed under GPLv2

# This tool updates jenkins build descriptions with extracts from result logs

my $numfile="mkcloudbuildstartnum";
my $startnum=`cat $numfile`;
my $endnum=$startnum+20;
for my $num ($startnum..$endnum) {
    my $build = "openstack-mkcloud/$num";
    $_ = `curl -s https://ci.suse.de/job/$build/consoleText`;
    last if m/<body><h2>HTTP ERROR 404/;
    next unless m/Finished: FAILURE/;
    system("echo \$((1+$num)) > $numfile");
    my $descr = "unknown cause";
    /java.lang.OutOfMemoryError/ and $descr=$&;
    /\+ '\[' (\d+) = 0 '\]'\n\+ exit 1\nBuild step/ and $1 and $descr="ret=$1";
    if(/The step '(\w+)' returned with exit code (\d+)/) {
        $descr="$1/ret=$2";
        if($2 eq "102") {
            if(m/RadosGW Tests: [^0]/) {$descr.="/radosgw"}
            if(m/Volume in VM: (\d+) & (\d+)/ and ($1||$2)) {$descr.="/volume=$1&$2"}
            if(m/Tempest: [^0]/) {
                $descr.="/tempest";
                if(m/FAILED \((failures=\d+)\)\n\+ tempestret=/) {$descr.="/$1"}
            }
        }
        if(m/Error: Committing the crowbar '\w+' proposal for '(\w+)' failed/) {$descr.="/$1"}
    }
    print "$build $descr\n";
    system("./japi", "setdescription", $build, $descr);
}<commit_msg>mkcloudresultcheck: parse tempest failure details<commit_after>#!/usr/bin/perl -w
use strict;
# 2015 by <NAME>
# Licensed under GPLv2

# This tool updates jenkins build descriptions with extracts from result logs

my $numfile="mkcloudbuildstartnum";
my $startnum=`cat $numfile`;
my $endnum=$startnum+20;
for my $num ($startnum..$endnum) {
    my $build = "openstack-mkcloud/$num";
    $_ = `curl -s https://ci.suse.de/job/$build/consoleText`;
    last if m/<body><h2>HTTP ERROR 404/;
    next unless m/Finished: FAILURE/;
    system("echo \$((1+$num)) > $numfile");
    my $descr = "unknown cause";
    /java.lang.OutOfMemoryError/ and $descr=$&;
    /\+ '\[' (\d+) = 0 '\]'\n\+ exit 1\nBuild step/ and $1 and $descr="ret=$1";
    if(/The step '(\w+)' returned with exit code (\d+)/) {
        $descr="$1/ret=$2";
        if($2 eq "102") {
            if(m/RadosGW Tests: [^0]/) {$descr.="/radosgw"}
            if(m/Volume in VM: (\d+) & (\d+)/ and ($1||$2)) {$descr.="/volume=$1&$2"}
            $descr.=tempestdetails() if(m/Tempest: [^0]/);
        }
        if(m/Error: Committing the crowbar '\w+' proposal for '(\w+)' failed/) {$descr.="/$1"}
    }
    print "$build $descr\n";
    system("./japi", "setdescription", $build, $descr);
}

sub tempestdetails {
    my $descr="/tempest";
    foreach my $regexp (
        'FAILED \((failures=\d+)\)\n\+ tempestret=',
        '(ServerFault): Got server fault',
        'Cannot get interface (MTU) on \'brq',
        '(Volume) \S+ failed to reach in-use status',
        '(SSHTimeout): Connection to the',
        '(KeyError): ',
        '(MismatchError): ',
        '(AssertionError): ',
    ) {
        if(m/$regexp/) {$descr.="/$1"}
    }
    return $descr;
}
{'fraction_non_alphanumeric': 0.21818181818181817, 'fraction_numerical': 0.019834710743801654, 'mean_word_length': 2.637019230769231, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5200806', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1102, 'n_words': 269}