<commit_before>#!/usr/bin/env bash

# Start DB container (if not on CircleCI)
echo "Starting DB container..."
if [ -z "$CIRCLECI" ] || [ "$CIRCLECI" = false ] ; then
    db_docker_id=$(docker run -d -p 5432:5432 -e 'POSTGRES_PASSWORD=<PASSWORD>' postgres)

    # Wait for DB to be ready
    echo "Waiting for DB to be ready..."
    sleep 5  # TODO: replace this by a test
fi

# Run unit tests
echo "Running unit tests..."
nosetests unittest.py

# Remove DB container (if not on CircleCI)
if [ -z "$CIRCLECI" ] || [ "$CIRCLECI" = false ] ; then
    echo "Removing DB container..."
    docker kill ${db_docker_id}
    docker rm -f ${db_docker_id}
fi
<commit_msg>fix test.sh<commit_after>#!/usr/bin/env bash

# Start DB container (if not on CircleCI)
echo "Starting DB container..."
if [ -z "$CIRCLECI" ] || [ "$CIRCLECI" = false ] ; then
    db_docker_id=$(docker run -d -p 5432:5432 -e 'POSTGRES_PASSWORD=<PASSWORD>' postgres)

    # Wait for DB to be ready
    echo "Waiting for DB to be ready..."
    sleep 5  # TODO: replace this by a test
fi

# Run unit tests
echo "Running unit tests..."
ret="$(nosetests unittest.py)"

# Remove DB container (if not on CircleCI)
if [ -z "$CIRCLECI" ] || [ "$CIRCLECI" = false ] ; then
    echo "Removing DB container..."
    docker kill ${db_docker_id}
    docker rm -f ${db_docker_id}
fi

exit ${ret}

{'fraction_non_alphanumeric': 0.14029850746268657, 'fraction_numerical': 0.013432835820895522, 'mean_word_length': 3.190625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2302482', 'n_tokens_mistral': 502, 'n_tokens_neox': 468, 'n_words': 169}