<commit_before>
#!/bin/bash

# Writing output (bell) keeps travis from timing out
# https://github.com/travis-ci/travis-ci/issues/7961
function bell() {
  while true; do
    echo -e "\a"
    sleep 60
  done
}
bell &

set -e

# The Travis VM isn't big enough to hold two Docker images of Scanner,
# so we have to push and delete the CPU image before building the GPU one.

if [[ "$TRAVIS_BRANCH" = "master" ]]; then
    TRAVIS_TAG="latest"
fi

test_docker() {
    INSTALL_SCANNERTOOLS="pushd /tmp && \
      git clone https://github.com/scanner-research/scannertools -b api-redesign && \
      cd scannertools/scannertools_infra && pip3 install . && \
      cd ../scannertools && pip3 install --user . && popd"

    if [[ "$TEST_TYPE" = "cpp" ]]; then
        TEST_COMMAND="cd /opt/scanner/build && CTEST_OUTPUT_ON_FAILURE=1 make test ARGS='-V -E PythonTests'"
    elif [[ "$TEST_TYPE" = "tutorials" ]]; then
        TEST_COMMAND="$INSTALL_SCANNERTOOLS && cd /opt/scanner/ && python3 setup.py test --addopts '-k test_tutorial'"
    elif [[ "$TEST_TYPE" = "integration" ]]; then
        TEST_COMMAND="cd /opt/scanner/ && python3 setup.py test --addopts '-k \\\"not test_tutorial\\\"'"
    fi
    # We add -local to make sure it doesn't run the remote image if the build fails.
    docker pull $DOCKER_TEST_REPO:$1-$TRAVIS_BUILD_NUMBER
    docker run $DOCKER_TEST_REPO:$1-$TRAVIS_BUILD_NUMBER /bin/bash \<commit_msg>Verbose install<commit_after>
#!/bin/bash

# Writing output (bell) keeps travis from timing out
# https://github.com/travis-ci/travis-ci/issues/7961
function bell() {
  while true; do
    echo -e "\a"
    sleep 60
  done
}
bell &

set -e

# The Travis VM isn't big enough to hold two Docker images of Scanner,
# so we have to push and delete the CPU image before building the GPU one.

if [[ "$TRAVIS_BRANCH" = "master" ]]; then
    TRAVIS_TAG="latest"
fi

test_docker() {
    INSTALL_SCANNERTOOLS="pushd /tmp && \
      git clone https://github.com/scanner-research/scannertools -b api-redesign && \
      cd scannertools/scannertools_infra && pip3 install . && \
      cd ../scannertools && pip3 install -e -v . && popd"

    if [[ "$TEST_TYPE" = "cpp" ]]; then
        TEST_COMMAND="cd /opt/scanner/build && CTEST_OUTPUT_ON_FAILURE=1 make test ARGS='-V -E PythonTests'"
    elif [[ "$TEST_TYPE" = "tutorials" ]]; then
        TEST_COMMAND="$INSTALL_SCANNERTOOLS && cd /opt/scanner/ && python3 setup.py test --addopts '-k test_tutorial'"
    elif [[ "$TEST_TYPE" = "integration" ]]; then
        TEST_COMMAND="cd /opt/scanner/ && python3 setup.py test --addopts '-k \\\"not test_tutorial\\\"'"
    fi
    # We add -local to make sure it doesn't run the remote image if the build fails.
    docker pull $DOCKER_TEST_REPO:$1-$TRAVIS_BUILD_NUMBER
    docker run $DOCKER_TEST_REPO:$1-$TRAVIS_BUILD_NUMBER /bin/bash \
{'fraction_non_alphanumeric': 0.13654050229925715, 'fraction_numerical': 0.00919702865228157, 'mean_word_length': 3.1649484536082473, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '733766', 'n_tokens_mistral': 1018, 'n_tokens_neox': 984, 'n_words': 280}