<commit_before>#!/bin/sh

if ! test -z "$1"
then
    HOST="$1"
else
    HOST="localhost"
fi

if ! test -z "$2"
then
    BASEPORT="$2"
else
    BASEPORT="59125"
fi

ENABLER_NAME="FA-TTS SE"

echo "Entering $ENABLER_NAME smoke test sequence. $ENABLER_NAME validation procedure engaged. Target host: $HOST, port: $BASEPORT"


REQUEST_URL=/info/version
echo "Run smoke test for $REQUEST_URL"

# During the first test we will tollerate some retries because the server
# may not be immediately available.
ITEM_RESULT=`curl -s --retry 8 --connect-timeout 5 -o /dev/null -w "%{http_code}" http://"$HOST:$BASEPORT$REQUEST_URL"`
if [ "$ITEM_RESULT" -ne "200" ]; then
        echo "Curl command for $REQUEST_URL failed. Validation procedure terminated."
        echo "Debug information: HTTP code $ITEM_RESULT instead of expected 200 from $HOST:$BASEPORT"
        exit 1;
else
        echo "Curl command for $REQUEST_URL OK."
fi

REQUEST_URL=/info/voices/all
echo "Run smoke test for $REQUEST_URL"

ITEM_RESULT=`curl -s -o /dev/null -w "%{http_code}" http://"$HOST:$BASEPORT$REQUEST_URL"`
if [ "$ITEM_RESULT" -ne "200" ]; then
        echo "Curl command for $REQUEST_URL failed. Validation procedure terminated."
        echo "Debug information: HTTP code $ITEM_RESULT instead of expected 200 from $HOST:$BASEPORT"<commit_msg>Trying to get more robust test for FA-TTS.<commit_after>#!/bin/sh

if ! test -z "$1"
then
    HOST="$1"
else
    HOST="localhost"
fi

if ! test -z "$2"
then
    BASEPORT="$2"
else
    BASEPORT="59125"
fi

ENABLER_NAME="FA-TTS SE"

echo "Entering $ENABLER_NAME smoke test sequence. $ENABLER_NAME validation procedure engaged. Target host: $HOST, port: $BASEPORT"


REQUEST_URL=/info/version
echo "Run smoke test for $REQUEST_URL"

# During the first test we will tollerate some retries because the server
# may not be immediately available.
n=0
retry=1
until [ $n -ge 8 ]
do
    ITEM_RESULT=`curl -s --connect-timeout 5 -o /dev/null -w "%{http_code}" http://"$HOST:$BASEPORT$REQUEST_URL"`
    if [ "$ITEM_RESULT" -eq "200" ]; then
	break
    fi
    n=$(($n+1))
    sleep $retry
    retry=$(($retry*2))
done
if [ "$ITEM_RESULT" -ne "200" ]; then
        echo "Curl command for $REQUEST_URL failed. Validation procedure terminated."
        echo "Debug information: HTTP code $ITEM_RESULT instead of expected 200 from $HOST:$BASEPORT"
        exit 1;
else
        echo "Curl command for $REQUEST_URL OK."
fi

REQUEST_URL=/info/voices/all
echo "Run smoke test for $REQUEST_URL"

ITEM_RESULT=`curl -s -o /dev/null -w "%{http_code}" http://"$HOST:$BASEPORT$REQUEST_URL"`
if [ "$ITEM_RESULT" -ne "200" ]; then
        echo "Curl command for $REQUEST_URL failed. Validation procedure terminated."
        echo "Debug information: HTTP code $ITEM_RESULT instead of expected 200 from $HOST:$BASEPORT"
{'fraction_non_alphanumeric': 0.12406417112299466, 'fraction_numerical': 0.0196078431372549, 'mean_word_length': 3.772108843537415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3894249', 'n_tokens_mistral': 980, 'n_tokens_neox': 900, 'n_words': 317}