<commit_before>#!/bin/bash

set -e
set -u

echo "Running setup.py install"
python setup.py install

echo "Running tests that don't need Clair"
pytest tests/ -v -m "not needs_clair" --cov clair_singularity --cov-report term-missing

if [[ $TRAVIS_PYTHON_VERSION == "3.5"* ]]; then
    echo "Python 3.5 - running docker tests with Clair"
    docker pull arminc/clair-db:2017-08-21
    docker run -d --name db arminc/clair-db:2017-08-21
    docker pull arminc/clair-local-scan:v2.0.0
    docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan:v2.0.0
    docker ps
    docker build -t clair_singularity .

    # Clear out any old .pyc from the local tests
    find . -name *.pyc -delete

    docker run -v $TRAVIS_BUILD_DIR:/app --privileged --name clair-singularity --link clair:clair clair_singularity pytest tests/ -v --cov clair_singularity --cov-report term-missing
    if [ $? -eq 0 ]; then
        # TODO - fix this bodge properly by running coveralls inside the container (think needs some ENV passed in)
        sudo ln -s $TRAVIS_BUILD_DIR /app
        coveralls -b $TRAVIS_BUILD_DIR
    fi
fi<commit_msg>I need some coffee...<commit_after>#!/bin/bash

set -e
set -u

echo "Running setup.py install"
python setup.py install

echo "Running tests that don't need Clair"
pytest tests/ -v -m "not needs_clair" --cov clair_singularity --cov-report term-missing

if [[ $TRAVIS_PYTHON_VERSION == "3.5"* ]]; then
    echo "Python 3.5 - running docker tests with Clair"
    docker pull arminc/clair-db:2017-08-21
    docker run -d --name db arminc/clair-db:2017-08-21
    docker pull arminc/clair-local-scan:v2.0.0
    docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan:v2.0.0
    docker ps
    docker build -t clair_singularity .

    # Clear out any old .pyc from the local tests
    find . -name *.pyc -delete

    docker run -v $TRAVIS_BUILD_DIR:/app --privileged --name clair-singularity --link clair:clair clair_singularity pytest tests/ -v --cov clair_singularity --cov-report term-missing
    if [ $? -eq 0 ]; then
        # TODO - fix this bodge properly by running coveralls inside the container (think needs some ENV passed in)
        sudo ln -s $TRAVIS_BUILD_DIR /app
        cd /app
        coveralls
    fi
fi
{'fraction_non_alphanumeric': 0.1060938185006576, 'fraction_numerical': 0.030688294607628234, 'mean_word_length': 2.7970049916805326, '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': '4201214', 'n_tokens_mistral': 870, 'n_tokens_neox': 781, 'n_words': 262}