<commit_before>#!/usr/bin/env bash

MODE="$1"; MODE=${MODE:="testing"}

setup_circle() {
  MAKE_ENV="CI=true"
  echo "setting up with MAKE_ENV: $MAKE_ENV"
  sudo adduser --disabled-password --gecos "" crew
  # need to add the crew user to the docker group
  sudo usermod -G docker crew
  #### circle does some weird *expletive* with regards to root and gh auth (needed for gitsubmodules test)
  sudo rsync -a ~ubuntu/.ssh/ ~root/.ssh/
  sudo chown -R root:root ~root/.ssh/
  sudo sed --in-place 's:/home/ubuntu:/root:g' ~root/.ssh/config
  ####
  sudo -E $MAKE_ENV make -e install
  sudo -E make -e setup-deploy-tests
  make -e ci-dependencies
}

case "$CIRCLE_NODE_INDEX" in
  0)
    echo "=====> make unit-tests (1/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
    [[ "$MODE" == "setup" ]] && setup_circle && exit 0
    sudo -E UNIT_TEST_BATCH=1 make -e unit-tests
    ;;

  1)
    echo "=====> make unit-tests (2/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
    [[ "$MODE" == "setup" ]] && setup_circle && exit 0
    sudo -E UNIT_TEST_BATCH=2 make -e unit-tests
    ;;
esac
<commit_msg>tests: create crew .ssh directory properly<commit_after>#!/usr/bin/env bash

MODE="$1"; MODE=${MODE:="testing"}

setup_circle() {
  MAKE_ENV="CI=true"
  echo "setting up with MAKE_ENV: $MAKE_ENV"
  sudo adduser --disabled-password --gecos "" crew
  sudo mkdir /home/crew/.ssh/
  sudo touch /home/crew/.ssh/authorized_keys
  sudo chmod 0700 /home/crew/.ssh/
  sudo chmod 0600 /home/crew/.ssh/authorized_keys
  sudo chown -R crew:crew /home/crew/
  # need to add the crew user to the docker group
  sudo usermod -G docker crew
  #### circle does some weird *expletive* with regards to root and gh auth (needed for gitsubmodules test)
  sudo rsync -a ~ubuntu/.ssh/ ~root/.ssh/
  sudo chown -R root:root ~root/.ssh/
  sudo sed --in-place 's:/home/ubuntu:/root:g' ~root/.ssh/config
  ####
  sudo -E $MAKE_ENV make -e install
  sudo -E make -e setup-deploy-tests
  make -e ci-dependencies
}

case "$CIRCLE_NODE_INDEX" in
  0)
    echo "=====> make unit-tests (1/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
    [[ "$MODE" == "setup" ]] && setup_circle && exit 0
    sudo -E UNIT_TEST_BATCH=1 make -e unit-tests
    ;;

  1)
    echo "=====> make unit-tests (2/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
    [[ "$MODE" == "setup" ]] && setup_circle && exit 0
    sudo -E UNIT_TEST_BATCH=2 make -e unit-tests
    ;;
esac

{'fraction_non_alphanumeric': 0.15106117353308365, 'fraction_numerical': 0.012484394506866416, 'mean_word_length': 3.2624113475177303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5080984', 'n_tokens_mistral': 970, 'n_tokens_neox': 879, 'n_words': 262}