<commit_before>#!/bin/bash

touch ~/.pylintrc
cd ./tests
PYTHONPATH=~/faucet ./test_min_pylint.sh
PYTHONPATH=~/faucet python3 -m pytest ./test_*.py --cov faucet --doctest-modules -v --cov-report term-missing
coveralls || true
cd ..

docker build -t ${FAUCET_TEST_IMG} -f Dockerfile.tests .
docker images

SINGLETESTS=`grep -E -o "^class (Faucet[a-zA-Z0-9]+Test)" tests/faucet_mininet_test_unit.py|cut -f2 -d" "|grep FaucetSingle`
PARALLELTESTS=`grep -E -o "^class (Faucet[a-zA-Z0-9]+Test)" tests/faucet_mininet_test_unit.py|cut -f2 -d" "|grep -v FaucetSingle`

echo single process tests: ${SINGLETESTS}
echo parallelizable tests: ${PARALLELTESTS}

case ${TRAVIS_MATRIX} in:
  SINGLE):
    RUNTESTS=${SINGLETESTS}
    ;;
  PARALLEL):
    RUNTESTS=${PARALLELTESTS}
    ;;
  *)
    RUNTESTS=''
    ;;
esac

sudo docker run --privileged -t -e FAUCET_TESTS="-d" ${FAUCET_TEST_IMG} ${RUN_TESTS}<commit_msg>switch/case.<commit_after>#!/bin/bash

touch ~/.pylintrc
cd ./tests
PYTHONPATH=~/faucet ./test_min_pylint.sh
PYTHONPATH=~/faucet python3 -m pytest ./test_*.py --cov faucet --doctest-modules -v --cov-report term-missing
coveralls || true
cd ..

docker build -t ${FAUCET_TEST_IMG} -f Dockerfile.tests .
docker images

SINGLETESTS=`grep -E -o "^class (Faucet[a-zA-Z0-9]+Test)" tests/faucet_mininet_test_unit.py|cut -f2 -d" "|grep FaucetSingle`
PARALLELTESTS=`grep -E -o "^class (Faucet[a-zA-Z0-9]+Test)" tests/faucet_mininet_test_unit.py|cut -f2 -d" "|grep -v FaucetSingle`

echo single process tests: ${SINGLETESTS}
echo parallelizable tests: ${PARALLELTESTS}

case ${TRAVIS_MATRIX} in
  SINGLE)
    RUNTESTS=${SINGLETESTS}
    ;;
  PARALLEL)
    RUNTESTS=${PARALLELTESTS}
    ;;
  *)
    RUNTESTS=''
    ;;
esac

sudo docker run --privileged -t -e FAUCET_TESTS="-d" ${FAUCET_TEST_IMG} ${RUN_TESTS}
{'fraction_non_alphanumeric': 0.160913140311804, 'fraction_numerical': 0.0077951002227171495, 'mean_word_length': 4.119658119658119, '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': '2312694', 'n_tokens_mistral': 808, 'n_tokens_neox': 772, 'n_words': 153}