<commit_before>#!/bin/bash
# Start the testing.

# Get script directory.
TEST="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT="$TEST/.."

# Start selenium server in the background and record its PID.
java -jar "$TEST/selenium.jar" -Dphantomjs.binary.path="$ROOT/node_modules/.bin/phantomjs" > /dev/null 2>&1 &

# Start the node server in the background and record its PID.
node "$TEST/server.js" > /dev/null 2>&1 &

printf "\nWaiting for servers to start..."
while true; do
  if ! curl --output /dev/null --silent --head --fail http://localhost:4444/wd/hub || ! curl --output /dev/null --silent --head --fail http://localhost:4000; then
    sleep 1;
    printf "."
  else
    printf "Done\n"
    break
  fi
done

printf "\nRunning tests with WebDriver...\n"
"$ROOT/node_modules/.bin/wdio" "$TEST/wdio.conf.js"

printf "\nKilling background processes..."
kill $(jobs -rp) && wait $(jobs -rp) > /dev/null 2>&1
printf "Done\n"<commit_msg>Save the exit code of the tests and pass it to parent.<commit_after>#!/bin/bash
# Start the testing.

# Get script directory.
TEST="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT="$TEST/.."

# Start selenium server in the background and record its PID.
java -jar "$TEST/selenium.jar" -Dphantomjs.binary.path="$ROOT/node_modules/.bin/phantomjs" > /dev/null 2>&1 &

# Start the node server in the background and record its PID.
node "$TEST/server.js" > /dev/null 2>&1 &

printf "\nWaiting for servers to start..."
while true; do
  if ! curl --output /dev/null --silent --head --fail http://localhost:4444/wd/hub || ! curl --output /dev/null --silent --head --fail http://localhost:4000; then
    sleep 1;
    printf "."
  else
    printf "Done\n"
    break
  fi
done

printf "\nRunning tests with WebDriver...\n"
"$ROOT/node_modules/.bin/wdio" "$TEST/wdio.conf.js"
RESULT=$?

printf "\nKilling background processes..."
kill $(jobs -rp) && wait $(jobs -rp) > /dev/null 2>&1
printf "Done\n"

exit $RESULT
{'fraction_non_alphanumeric': 0.17562724014336917, 'fraction_numerical': 0.01638504864311316, 'mean_word_length': 3.238611713665944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5776865', 'n_tokens_mistral': 701, 'n_tokens_neox': 650, 'n_words': 211}