<commit_before>#!/bin/bash

ERROR=0;
function run {
    echo
    echo "==============================================="
    echo $1
    echo "==============================================="
    echo
    shift
    $@
    if [ $? -eq 0 ]; then return; fi
    ERROR=1
}

###### RUN TESTS #######

export JUNIT_OUTPUT_FILE=sync_tests.xml
run "Sync tests"        prove --harness=TAP::Harness::JUnit -l t/*/*.t

export JUNIT_OUTPUT_FILE=yaml_lwp.xml
run 'YAML: HTTPTiny'    ./test/run_yaml_tests.pl --junit

export JUNIT_OUTPUT_FILE=yaml_netcurl.xml
run 'YAML: NetCurl'     ./test/run_yaml_tests.pl  --cxn NetCurl

export JUNIT_OUTPUT_FILE=yaml_netcurl.xml
run 'YAML: Hijk'        ./test/run_yaml_tests.pl  --cxn Hijk

export ES_BODY='POST'

export JUNIT_OUTPUT_FILE=sync_post.xml
run 'Sync tests - POST body' prove --harness=TAP::Harness::JUnit -l t/*/*.t

export JUNIT_OUTPUT_FILE=yaml_post.xml
run 'YAML::HTTPTiny - POST body' ./test/run_yaml_tests.pl --junit

perl -e 'exit $ENV{ES_VERSION}=~/^0.90.(10|[0-9])$/ ? 1 : 0';
if [ $? -eq 1 ];
    then echo "SKIPPING body-as-source: $ES_VERSION"
    exit $ERROR
fi

export ES_BODY='source'

export JUNIT_OUTPUT_FILE=sync_source.xml
run 'Sync tests - source body' prove --harness=TAP::Harness::JUnit -l t/*/*.t

export JUNIT_OUTPUT_FILE=yaml_post.xml
run 'YAML::HTTPTiny - source body' ./test/run_yaml_tests.pl --junit

#########################
<commit_msg>Temporarily test only update yaml tests on Hijk<commit_after>#!/bin/bash

ERROR=0;
function run {
    echo
    echo "==============================================="
    echo $1
    echo "==============================================="
    echo
    shift
    $@
    if [ $? -eq 0 ]; then return; fi
    ERROR=1
}

###### RUN TESTS #######

#export JUNIT_OUTPUT_FILE=sync_tests.xml
#run "Sync tests"        prove --harness=TAP::Harness::JUnit -l t/*/*.t
#
#export JUNIT_OUTPUT_FILE=yaml_lwp.xml
#run 'YAML: HTTPTiny'    ./test/run_yaml_tests.pl --junit
#
#export JUNIT_OUTPUT_FILE=yaml_netcurl.xml
#run 'YAML: NetCurl'     ./test/run_yaml_tests.pl  --cxn NetCurl

export JUNIT_OUTPUT_FILE=yaml_netcurl.xml
run 'YAML: Hijk'        ./test/run_yaml_tests.pl  --cxn Hijk --trace elasticsearch/rest-api-spec/test/update/

#export ES_BODY='POST'
#
#export JUNIT_OUTPUT_FILE=sync_post.xml
#run 'Sync tests - POST body' prove --harness=TAP::Harness::JUnit -l t/*/*.t
#
#export JUNIT_OUTPUT_FILE=yaml_post.xml
#run 'YAML::HTTPTiny - POST body' ./test/run_yaml_tests.pl --junit
#
#perl -e 'exit $ENV{ES_VERSION}=~/^0.90.(10|[0-9])$/ ? 1 : 0';
#if [ $? -eq 1 ];
#    then echo "SKIPPING body-as-source: $ES_VERSION"
#    exit $ERROR
#fi
#
#export ES_BODY='source'
#
#export JUNIT_OUTPUT_FILE=sync_source.xml
#run 'Sync tests - source body' prove --harness=TAP::Harness::JUnit -l t/*/*.t
#
#export JUNIT_OUTPUT_FILE=yaml_post.xml
#run 'YAML::HTTPTiny - source body' ./test/run_yaml_tests.pl --junit

#########################

{'fraction_non_alphanumeric': 0.2266803840877915, 'fraction_numerical': 0.009602194787379973, 'mean_word_length': 3.977815699658703, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, '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': '2452032', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1090, 'n_words': 231}