<commit_before>#!/bin/bash

_volume_path=/home/bitergia/fiware-devguide-app
pushd $( dirname $0 ) > /dev/null
_local_path=$( dirname $(pwd) )
popd > /dev/null
cd ${_local_path}

_compose_path="docker/compose"
_yml="${_compose_path}/docker-compose.yml"

function start_test_env() {

    local _max_tries=60
    local _started=0
    local _tries=0
    local ret=0

    # setup compose.yml to enable volume on devguide if not enabled
    sed -i "${_yml}" \
        -e "/^devguide:/,$ s|.*:${_volume_path}|        - ${_local_path}:${_volume_path}|" \
        -e "s|#[ ]*volumes:|volumes:|"

    # start containers with docker-compose
    docker-compose -f "${_yml}" -p tests up -d

    # wait for devguide to be ready
    container_name=$( docker-compose -f "${_yml}" -p tests ps 2>/dev/null | grep _devguide_ | cut -d ' ' -f 1 )
    echo "Waiting for devguide to be ready."
    while [ ${_started} -eq 0 -a ${_tries} -lt ${_max_tries} ]; do
        if ( docker logs ${container_name} | grep -qE "service apache2 reload" ) ; then
            _started=1
        else
            _tries=$(( ${_tries} + 1 ))
        fi
        sleep 1
    done

    if [ ${_started} -eq 0 ]; then
        echo "Test environment not ready.  Aborting."
        ${0} stop
        ret=1
    else
        echo "Test environment ready."
        ret=0
    fi

    exit ${ret}
}
<commit_msg>Uncomment volumes only on devguide when setting up test environment.<commit_after>#!/bin/bash

_volume_path=/home/bitergia/fiware-devguide-app
pushd $( dirname $0 ) > /dev/null
_local_path=$( dirname $(pwd) )
popd > /dev/null
cd ${_local_path}

_compose_path="docker/compose"
_yml="${_compose_path}/docker-compose.yml"

function start_test_env() {

    local _max_tries=60
    local _started=0
    local _tries=0
    local ret=0

    # setup compose.yml to enable volume on devguide if not enabled
    sed -i "${_yml}" \
        -e "/^devguide:/,$ s|.*:${_volume_path}|        - ${_local_path}:${_volume_path}|" \
        -e "/^devguide:/,$ s|#[ ]*volumes:|volumes:|"

    # start containers with docker-compose
    docker-compose -f "${_yml}" -p tests up -d

    # wait for devguide to be ready
    container_name=$( docker-compose -f "${_yml}" -p tests ps 2>/dev/null | grep _devguide_ | cut -d ' ' -f 1 )
    echo "Waiting for devguide to be ready."
    while [ ${_started} -eq 0 -a ${_tries} -lt ${_max_tries} ]; do
        if ( docker logs ${container_name} | grep -qE "service apache2 reload" ) ; then
            _started=1
        else
            _tries=$(( ${_tries} + 1 ))
        fi
        sleep 1
    done

    if [ ${_started} -eq 0 ]; then
        echo "Test environment not ready.  Aborting."
        ${0} stop
        ret=1
    else
        echo "Test environment ready."
        ret=0
    fi

    exit ${ret}
}

{'fraction_non_alphanumeric': 0.14301075268817204, 'fraction_numerical': 0.012186379928315413, 'mean_word_length': 2.387135922330097, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6579075', 'n_tokens_mistral': 1058, 'n_tokens_neox': 964, 'n_words': 278}