<commit_before>#!/bin/bash

# Script for running a single test class or test profile
# Outputs the logs in folder

DATE=`date +%Y-%m-%d:%H:%M`

while getopts "T:P:dsc" opt;
do
    case ${opt} in
        T)
        # specify testing class to be run
            TESTCLASS="-Dit.test=${2}"
            FILENAME="$2"
            ;;
        P)
        # specify testing profile to be run
            PROFILE="-P${2}"
            FILENAME="$2"
            ;;
        d)
        # enable remote debugging
            DEBUG="-Dmaven.failsafe.debug"
            ;;
        s)
        # Skip unit tests
            SKIP="-Dskip.surefire.tests=true"
            ;;
        c)
        # reset/empty database before running
            DROPDB=true
            ;;
    esac
done

if [ "${DROPDB}" == "true" ]
then
    echo "drop database irida_test; create database irida_test;" | mysql -u root
fi

mkdir ~/Desktop/logs/
xvfb-run mvn clean verify ${SKIP} ${TESTCLASS} ${PROFILE} ${DEBUG} | tee ~/Desktop/logs/${DATE}-${FILENAME}.logs<commit_msg>added for for loop, to specify how many times to repeat the tests<commit_after>#!/bin/bash

# Script for running a single test class or test profile
# Outputs the logs in folder

DATE=`date +%Y-%m-%d:%H:%M`

while getopts "T:P:dsc" opt;
do
    case ${opt} in
        T)
        # specify testing class to be run
            TESTCLASS="-Dit.test=${2}"
            FILENAME="$2"
            ;;
        P)
        # specify testing profile to be run
            PROFILE="-P${2}"
            FILENAME="$2"
            ;;
        d)
        # enable remote debugging
            DEBUG="-Dmaven.failsafe.debug"
            ;;
        s)
        # Skip unit tests
            SKIP="-Dskip.surefire.tests=true"
            ;;
        c)
        # reset/empty database before running
            DROPDB=true
            ;;
    esac
done

COMMIT=`git rev-parse HEAD`

for run in {1..1}
do

DATE=`date +%Y-%m-%d:%H:%M`

if [ "${DROPDB}" == "true" ]
then
    echo "drop database irida_test; create database irida_test;" | mysql -u root
fi

mkdir ~/Desktop/logs/
echo "Current commit: ${COMMIT}"
xvfb-run mvn clean verify ${SKIP} ${TESTCLASS} ${PROFILE} ${DEBUG} | tee ~/Desktop/logs/${DATE}-${COMMIT}-${FILENAME}.logs

done
{'fraction_non_alphanumeric': 0.1356537260151718, 'fraction_numerical': 0.004462293618920125, 'mean_word_length': 1.8817480719794344, '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': '3344656', 'n_tokens_mistral': 744, 'n_tokens_neox': 702, 'n_words': 204}