<commit_before>#!/bin/bash

set -e
set -u

: ${DOCKER:=}

if [ -n "${DOCKER}" ]; then
  docker run \
         --interactive \
         --tty \
          groonga/groonga-${DOCKER}
  exit $?
fi

: ${ENABLE_MRUBY:=no}
: ${TEST_TARGET:=all}

prefix=/tmp/local

command_test_options=""
command_test_options="${command_test_options} --reporter=mark"
command_test_options="${command_test_options} --timeout=60"
command_test_options="${command_test_options} --read-timeout=30"
command_test_options="${command_test_options} --n-retries=3"

set -x

export COLUMNS=79

retry()
{
  local i=0
  while ! "$@"; do
    if [ $i -eq 3 ]; then
      exit 1
    fi
    i=$((i + 1))
  done
}

if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
  memory_fs_size=$[768 * 1024 * 1024] # 768MiB
  byte_per_sector=512
  n_sectors=$[${memory_fs_size} / ${byte_per_sector}]
  memory_fs_device_path=$(hdid -nomount ram://${n_sectors})
  newfs_hfs ${memory_fs_device_path}
  mkdir -p tmp
  mount -t hfs ${memory_fs_device_path} tmp

  command_test_options="${command_test_options} --n-workers=2"
  # if [ "${TEST_TARGET}" = "command" ]; then
  #   command_test_options="${command_test_options} --no-suppress-backtrace"
  # fi
else
  command_test_options="${command_test_options} --n-workers=4"
fi

case "${BUILD_TOOL}" in<commit_msg>travis macos: increase the number of openable files<commit_after>#!/bin/bash

set -e
set -u

: ${DOCKER:=}

if [ -n "${DOCKER}" ]; then
  docker run \
         --interactive \
         --tty \
          groonga/groonga-${DOCKER}
  exit $?
fi

: ${ENABLE_MRUBY:=no}
: ${TEST_TARGET:=all}

prefix=/tmp/local

command_test_options=""
command_test_options="${command_test_options} --reporter=mark"
command_test_options="${command_test_options} --timeout=60"
command_test_options="${command_test_options} --read-timeout=30"
command_test_options="${command_test_options} --n-retries=3"

set -x

export COLUMNS=79

retry()
{
  local i=0
  while ! "$@"; do
    if [ $i -eq 3 ]; then
      exit 1
    fi
    i=$((i + 1))
  done
}

if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
  memory_fs_size=$[768 * 1024 * 1024] # 768MiB
  byte_per_sector=512
  n_sectors=$[${memory_fs_size} / ${byte_per_sector}]
  memory_fs_device_path=$(hdid -nomount ram://${n_sectors})
  newfs_hfs ${memory_fs_device_path}
  mkdir -p tmp
  mount -t hfs ${memory_fs_device_path} tmp

  sudo sysctl -w kern.maxfiles=8192
  sudo sysctl -w kern.maxfilesperproc=8192

  command_test_options="${command_test_options} --n-workers=2"
  # if [ "${TEST_TARGET}" = "command" ]; then
  #   command_test_options="${command_test_options} --no-suppress-backtrace"
  # fi
else
  command_test_options="${command_test_options} --n-workers=4"
fi

case "${BUILD_TOOL}" in
{'fraction_non_alphanumeric': 0.16309171597633135, 'fraction_numerical': 0.02514792899408284, 'mean_word_length': 4.05607476635514, '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': '3989383', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1032, 'n_words': 192}