<commit_before>#!/bin/bash

machine=${$1:-default}
eval $(docker-machine env ${machine})
export HOST_IP=$(docker-machine ip ${machine})
echo Running tests on host: $HOST_IP

cleanup() {
  docker-compose -p leader-election stop
  docker-compose -p leader-election rm -f
}

docker-compose -p leader-election up -d --force-recreate

rm -rf tmp/leader-election-dir
mkdir -p tmp/leader-election-dir
export TEST_DIR=tmp/leader-election-dir

run() {
  docker-compose run -e HOST_IP=${HOST_IP} -e TEST_DIR=/test-state test /scripts/$1
}
success='false'
for ((n=1;n<120;n++)); do
  echo "trying"
  if run leader_is_available.sh; then
    success='true'
    break
  fi
  sleep 1
done

if [[ $success != 'true' ]]; then
  cleanup
  exit 1
fi

run basic-storage.sh
cleanup
<commit_msg>Remove creation of test-dir<commit_after>#!/bin/bash

machine=${$1:-default}
eval $(docker-machine env ${machine})
export HOST_IP=$(docker-machine ip ${machine})
echo Running tests on host: $HOST_IP

cleanup() {
  docker-compose -p leader-election stop
  docker-compose -p leader-election rm -f
}

docker-compose -p leader-election up -d --force-recreate

run() {
  docker-compose run -e HOST_IP=${HOST_IP} -e TEST_DIR=/test-state test /scripts/$1
}
success='false'
for ((n=1;n<120;n++)); do
  echo "trying"
  if run leader_is_available.sh; then
    success='true'
    break
  fi
  sleep 1
done

if [[ $success != 'true' ]]; then
  cleanup
  exit 1
fi

run basic-storage.sh
cleanup

{'fraction_non_alphanumeric': 0.1450171821305842, 'fraction_numerical': 0.010996563573883162, 'mean_word_length': 3.9023569023569022, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3079856', 'n_tokens_mistral': 550, 'n_tokens_neox': 519, 'n_words': 147}