<commit_before>const _ = require('lodash');
const exec = require('shell-utils').exec;

const release = _.includes(process.argv, 'release');

function buildProjForDetox() {
  const scheme = release ? `playground_release` : `playground`;
  const conf = release ? `Release` : `Debug`;

  const cmd = `RCT_NO_LAUNCH_PACKAGER=true
            cd ./playground/ios && xcodebuild
            build
            -scheme ${scheme}
            -project playground.xcodeproj
            -sdk iphonesimulator
            -configuration ${conf}
            -derivedDataPath ./DerivedData/playground
            ONLY_ACTIVE_ARCH=YES`;

  if (exec.which(`xcpretty`)) {
    exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`);
  } else {
    exec.execSync(`${cmd}`);
  }
}

function runDetoxUsingMocha() {
  const detoxAppBuildPath = `playground/ios/DerivedData/playground/Build/Products/${release ? 'Release' : 'Debug'}-iphonesimulator/playground.app`;

  exec.execSync(`detoxAppBuildPath="${detoxAppBuildPath}"
                              BABEL_ENV=test
                              ./node_modules/mocha/bin/mocha e2e
                                --timeout ${2 * 60 * 1000}
                                --recursive
                                --bail`);
}

function e2e() { //eslint-disable-line
  try {
    runDetoxUsingMocha();
  } finally {
    if (process.env.CI) {
      exec.kill(`Simulator`);
      exec.kill(`CoreSimulator`);
      exec.execSync(`sleep 5`);
    }
  }
}

function run() {
  if (!exec.which(`fbsimctl`)) {
    throw new Error(`fbsimctl must be installed: "brew tap facebook/fb && brew install fbsimctl"`);
  }
  buildProjForDetox();
  e2e();
}

run();<commit_msg>increase ios e2e timeout to 5 minutes due to flaky travis builds<commit_after>const _ = require('lodash');
const exec = require('shell-utils').exec;

const release = _.includes(process.argv, 'release');

function buildProjForDetox() {
  const scheme = release ? `playground_release` : `playground`;
  const conf = release ? `Release` : `Debug`;

  const cmd = `RCT_NO_LAUNCH_PACKAGER=true
            cd ./playground/ios && xcodebuild
            build
            -scheme ${scheme}
            -project playground.xcodeproj
            -sdk iphonesimulator
            -configuration ${conf}
            -derivedDataPath ./DerivedData/playground
            ONLY_ACTIVE_ARCH=YES`;

  if (exec.which(`xcpretty`)) {
    exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`);
  } else {
    exec.execSync(`${cmd}`);
  }
}

function runDetoxUsingMocha() {
  const detoxAppBuildPath = `playground/ios/DerivedData/playground/Build/Products/${release ? 'Release' : 'Debug'}-iphonesimulator/playground.app`;

  exec.execSync(`detoxAppBuildPath="${detoxAppBuildPath}"
                              BABEL_ENV=test
                              ./node_modules/mocha/bin/mocha e2e
                                --timeout ${5 * 60 * 1000}
                                --recursive
                                --bail`);
}

function e2e() { //eslint-disable-line
  try {
    runDetoxUsingMocha();
  } finally {
    if (process.env.CI) {
      exec.kill(`Simulator`);
      exec.kill(`CoreSimulator`);
      exec.execSync(`sleep 5`);
    }
  }
}

function run() {
  if (!exec.which(`fbsimctl`)) {
    throw new Error(`fbsimctl must be installed: "brew tap facebook/fb && brew install fbsimctl"`);
  }
  buildProjForDetox();
  e2e();
}

run();
{'fraction_non_alphanumeric': 0.13865423827556073, 'fraction_numerical': 0.007573550830177687, 'mean_word_length': 2.2704761904761903, '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': '4379613', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1081, 'n_words': 200}