<commit_before>#!/bin/bash
#
# Runs client bindings tests.
#
# Usage: ./run_tests.sh

export NUCLEUS_ENV=integrationTest

root=`dirname "$0"`

source "$root/environment"
export DB_PORT=`../bin/nuc-config mongod.port`
export DX_APISERVER_PORT=`../bin/nuc-config apiserver.port`
export DX_APISERVER_HOST=localhost
export PYTHONPATH="$root/../execserver/env/lib/python2.7/site-packages:$PYTHONPATH"

dbpath="$root/test_db"
mkdir -p "$dbpath"
rm -rf "$dbpath"/*

echo "Starting MongoDB in path '$dbpath' and port '$DB_PORT'"
mongod --dbpath "$dbpath" --port $DB_PORT --nojournal --noprealloc >> "$root/mongod.log" &
mongod_pid=$!

echo -n "Starting API server on port $APISERVER_PORT..."
"$root"/../apiserver/server.js --port $APISERVER_PORT > apiserver.log 2>&1 &
api_server_pid=$!
echo " (PID $api_server_pid)"

# Need to wait until the API server is up and ready to handle requests before
# starting to run tests.
sleep 3

echo -n "Initializing database..."
"$root"/../apiserver/tasks/init_database.js<commit_msg>Fix references left over by d1982cb.<commit_after>#!/bin/bash
#
# Runs client bindings tests.
#
# Usage: ./run_tests.sh

export NUCLEUS_ENV=integrationTest

root=`dirname "$0"`

source "$root/environment"
export DB_PORT=`../bin/nuc-config mongod.port`
export DX_APISERVER_PORT=`../bin/nuc-config apiserver.port`
export DX_APISERVER_HOST=localhost
export PYTHONPATH="$root/../execserver/env/lib/python2.7/site-packages:$PYTHONPATH"

dbpath="$root/test_db"
mkdir -p "$dbpath"
rm -rf "$dbpath"/*

echo "Starting MongoDB in path '$dbpath' and port '$DB_PORT'"
mongod --dbpath "$dbpath" --port $DB_PORT --nojournal --noprealloc >> "$root/mongod.log" &
mongod_pid=$!

echo -n "Starting API server on port $DX_APISERVER_PORT..."
"$root"/../apiserver/server.js --port $DX_APISERVER_PORT > apiserver.log 2>&1 &
api_server_pid=$!
echo " (PID $api_server_pid)"

# Need to wait until the API server is up and ready to handle requests before
# starting to run tests.
sleep 3

echo -n "Initializing database..."
"$root"/../apiserver/tasks/init_database.js
{'fraction_non_alphanumeric': 0.15538236726741353, 'fraction_numerical': 0.007793472966390648, 'mean_word_length': 4.689750692520776, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5951792', 'n_tokens_mistral': 785, 'n_tokens_neox': 737, 'n_words': 186}